Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP7 SP1 - More Automation Woes with Word now!
Message
From
30/01/2002 13:59:00
 
 
To
30/01/2002 13:34:52
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00612757
Message ID:
00612948
Views:
26
Tamar:

>IAC, what's the goal of the code?

I have an RTF parser which I use to build documents. The parser doesn't support more than one section in a Word document. I have built two documents. The first is a dynamically sized insurance proposal form. The second is an agents "cover instruction" sheet (to us). The system produces the two documents and then submits them to our network faxing system for delivery to our agents.

Rather than sending two faxes, I decided to merge the documents together. However, both documents make extensive use of headers/footers. When I merge the documents together, the headers/footers of both documents conflict.

The code is the answer. First, I create a new section for every page. So, the code starts at the top of the first page. I have asked in the past how I could get a range on a page and the answer was with difficulty. I discovered the Word inbuilt \Page bookmark. This gives me the range on the page. Collapse to the end of the range and insert the section break. The browse to the next page and start again. Sweet!

When the first document is originally processed, the last page is created with a page break. When this is subsequently processed by my code, I need to strip the pagebreak out and replace it with a section break. I then add the second document to the first (as per Yuri's tip) and bingo, I have a merged document where each page is in its own section.

Another program then loops through the headers/footers collection and sets the LinkToPrevious property to false. It then adds in the correct content to the headers/footers which doesn't impact on the document sections/pages lower down in the document.

This way, I can merge the documents, control what is happening in the Headers/Footers and auto-fax just one completed document. Of course, if you are only printing, there is not such probem - you just drop the documents on the printer.

The use of range/selection is OK. Certain things are more intuitive (to me) using selection. Also, "selection" supports some usefull directional methods that range does not.

Irrespective, it runs like a charm in VFP 6 and dies in VFP7. I love VFP and V7 but I will have to go back to VFP6 for the second time if I am to run this code or something like it and I *do* need to run this code.

Automation seems to have gone pearshaped in VFP7 for all but "routine" stuff. I have an Outlook automation routine that died straight away when I first got VFP7. I demonstrated the problem and Jim Saunders passed it up as a bug some 5-6 months ago. Sure enough in SP1, the bug was detailed as fixed. I reinstalled VFP 7 (happy as a sand boy), and the first time it run, it crashed again, the "fix" seemingly not actually fixed.

This problem is like insult to injury. Ken wants people to upgrade to VFP7. We are at SP1 now and for me, it is totally unusable. How can this be?

-Gary
-=Gary
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform