No clue, but might this be of some assistance? http://vbex.ru/index.php/VBA/Excel/Access/Word/Word/Document_Header_Footer
On Thu, Oct 8, 2015 at 8:27 AM, Collin B <[email protected]> wrote: > As previously observed I'm not much of a VBA guru. > Writing Excel macro. > Need to create Word document and write header with auto page numbers. > (Office 365). > Research has proven unfruitful. > This is what I've come up with. > On the .TypeText Text:="Page " line I get "object required" for some > reason. Can't figure out why. > > Set objHeader = > wDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range > > With objHeader.Select > .TypeText Text:="Page " > .Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:="PAGE > ", PreserveFormatting:=True > .TypeText Text:=" of " > .Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, > Text:="NUMPAGES ", PreserveFormatting:=True > .TypeText = oText > End With > > > -- > PDML Pentax-Discuss Mail List > [email protected] > http://pdml.net/mailman/listinfo/pdml_pdml.net > to UNSUBSCRIBE from the PDML, please visit the link directly above and follow > the directions. -- Life is too short to put up with bad bokeh. -- PDML Pentax-Discuss Mail List [email protected] http://pdml.net/mailman/listinfo/pdml_pdml.net to UNSUBSCRIBE from the PDML, please visit the link directly above and follow the directions.

