J
jb_Live
I am trying create a footer in Word using VBScript.
Currently i am only able to insert 1 wdfield.
How do you insert 2 wdfields into a footer?
How do you insert date saved and filename into a word footer?
Here is what i have so far. My script creates a new word document, then
insert the footer with wdfieldlastsavedon and then wdFieldFileName overwrite
it.
Const wdFieldFileName = 29
Const wdFieldSaveDate = 22
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()
objDoc.Fields.Add objDoc.Sections(1).footers(1).Range, wdFieldSaveDate
'objDoc.Sections(1).footers(1).Range.ParagraphFormat.Alignment = 0
objDoc.Fields.Add objDoc.Sections(1).footers(1).Range, wdFieldFileName
objDoc.Sections(1).footers(1).Range.ParagraphFormat.Alignment = 2
Currently i am only able to insert 1 wdfield.
How do you insert 2 wdfields into a footer?
How do you insert date saved and filename into a word footer?
Here is what i have so far. My script creates a new word document, then
insert the footer with wdfieldlastsavedon and then wdFieldFileName overwrite
it.
Const wdFieldFileName = 29
Const wdFieldSaveDate = 22
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()
objDoc.Fields.Add objDoc.Sections(1).footers(1).Range, wdFieldSaveDate
'objDoc.Sections(1).footers(1).Range.ParagraphFormat.Alignment = 0
objDoc.Fields.Add objDoc.Sections(1).footers(1).Range, wdFieldFileName
objDoc.Sections(1).footers(1).Range.ParagraphFormat.Alignment = 2