Information générale
Catégorie:
COM/DCOM et 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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement