General information
Category:
COM/DCOM and OLE Automation
I was not able to find a stright solution. However you could just replace header/footer in the sections belonging to different documents:
oWord = CREATEOBJECT("Word.Application")
lcfile1="c:\_1.doc"
lcfile2="c:\_2.doc"
oWord.documents.open(lcfile1)
wdStory=6
wdSectionBreakNextPage=2
wdHeaderFooterPrimary=1
with oWord
.Selection.EndKey(wdStory)
.Selection.InsertBreak(wdSectionBreakNextPage)
.Selection.InsertFile(lcfile2)
with .ActiveDocument.Sections(1)
.Headers(wdHeaderFooterPrimary).Range.Text = "Header text for Section1"
.Footers(wdHeaderFooterPrimary).Range.Text = "Footer text for Section1"
endwith
with .ActiveDocument.Sections(2)
.Headers(wdHeaderFooterPrimary).Range.Text = "2 Header text"
.Footers(wdHeaderFooterPrimary).Range.Text = "2 Footer text"
endwith
endwith
......
At least it is a solution, though not elegant.
>Yuri:
>
>>I will let you know if succeed.
>
>Thank you so much.
>
>-Gary
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only