Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combining two Word documents - How?
Message
From
30/01/2002 02:56:15
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00612320
Message ID:
00612626
Views:
26
Yuri:

Thanks for the further advice. It doesn't have to be elegant, just do the job. Your advice has lead me down another path that I wouldn't have thought of before. I will let you know how I get on.

Thanks for taking the time to come up with the code examples you provided. They have helped me tremendously.

Best

-Gary

>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
-=Gary
Previous
Reply
Map
View

Click here to load this message in the networking platform