I have the task of upgrading out programs from Word 2003 to 2007. In one of the programs we copy a pre-existing Word document, rename it open set the page numbers to X of Y using automation from Excel. We then further add to that document ranges from the Excel workbook.
With Word 07 it appears somethings need changing. I can add "of Y" but can't get the "X". The following works in Word. But I can't seem to get the syntax correct from Excel.
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
Selection.Range.InsertAlignmentTab Alignment:=1
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"PAGE \* ArabicDash ", PreserveFormatting:=True
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
The line I just can't reference corretly is:
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"PAGE \* ArabicDash ", PreserveFormatting:=True
Thanks in advance!!!
With Word 07 it appears somethings need changing. I can add "of Y" but can't get the "X". The following works in Word. But I can't seem to get the syntax correct from Excel.
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
Selection.Range.InsertAlignmentTab Alignment:=1
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"PAGE \* ArabicDash ", PreserveFormatting:=True
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
The line I just can't reference corretly is:
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"PAGE \* ArabicDash ", PreserveFormatting:=True
Thanks in advance!!!