Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Allow user to modify a Word document?
Message
From
12/01/2009 15:28:16
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01372571
Message ID:
01372932
Views:
30
>>I don't understand, that file is there during compilation,
>I'm not worried about compiling. The question was about the hard-coded path to the MSWord.olb file at the time of instantiation of the eventhandler. (I can't test to see if that produces an error because I don't have another Word version available.) In the client's environment users may have any version of Word from 8 upward. Some may have more than one version installed, either as part of Office or as a stand-alone application.
>
>Thank you for the expanded code sample. I'll work with it for a while and let you know how it goes. Perhaps part of the problem is the way the code is being called. There is a class that handles Word automation. It works perfectly for the 16 out of 18 documents that are produced entirely without user intervention. For the 2 documents that allow user editing, I would like to run this code to allow the user to edit. When the user is done editing, control should pass to the next line in the automation class--where the document will be saved (if allowed) and/or printed to PDF or to Printer, depending upon the situation. The problem is that I want Word to remain open so that processing can continue. Sounds easy enough but so far, hasn't worked well.
>
>Here is my update after testing the code you provided: I still do not see a way for VFP's automation process to regain control of the open instance of Word. The ONLY way VFP regains control seems to be when Word is closed. Has anyone ever accomplished this?

Lynda,
Then do not call Quit() (VFP already has control - check those messages printed in VFP window. Maybe you mean window.activate).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform