Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
word 2007 macro
I am trying to record a macro to add the filepath to the page footer.
Having saved the page and recorded the macro, I get an error message: Run-time error 5941. The requested member of the collection does not exist. The debugger shows the following code: Sub Macro1() ' ' Macro1 Macro ' ' Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _ "FILENAME ", PreserveFormatting:=True End Sub Sub Macro2() ' ' Macro2 Macro ' ' WordBasic.ViewFooterOnly ActiveDocument.AttachedTemplate.BuildingBlockEntri es(" Blank").Insert _ Whe=Selection.Range, RichText:=True Selection.Delete Unit:=wdCharacter, Count:=1 Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _ "FILENAME ", PreserveFormatting:=True End Sub The two lines beginning 'ActiveDocument...' are highlighted. Can anyone help me to sort this out? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I change a macro name (word 2007) | Microsoft Word Help | |||
macro in word 2007 | Microsoft Word Help | |||
macro in word 2007 | Page Layout | |||
Word 2007 Macro Security | Microsoft Word Help | |||
Macro toolbars in word 2007 | Microsoft Word Help |