Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combining two Word documents - How?
Message
 
À
29/01/2002 17:02:12
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00612320
Message ID:
00612591
Vues:
30
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
Fil
Voir

Click here to load this message in the networking platform