got curious because i used to do lots of weird field setups in Word,
data-driven from Visual FoxPro …
from my AppleScript experience, i like to avoid "selecting" objects because
an object model should work without having to think of it as a robot user
working through the interface
also, i'm not using With because that may interfere with redefining the range
again, i have no way to test this
Set objHeader = wDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range
objHeader.TypeText Text:="Page XX of YY " + oText
objHeader.Find.Execute FindText:="XX", Forward:=True
objHeader.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:="PAGE", PreserveFormatting:=True
objHeader.Find.Execute FindText:="YY", Forward:=True
objHeader.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:="NUMPAGES ", PreserveFormatting:=True
--
PDML Pentax-Discuss Mail List
PDML@pdml.net
http://pdml.net/mailman/listinfo/pdml_pdml.net
to UNSUBSCRIBE from the PDML, please visit the link directly above and follow
the directions.