Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CLOSING MS WORD WITHOUT PROMPTING TO SAVE CHANGES
Message
From
09/03/2000 17:14:04
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00343803
Message ID:
00343890
Views:
24
Hi Dave,

Nice to have you respond once again to one of my questions. The problem is that I open WORD up via automation. Play with it. Print the document and don't get back to VFP until I close WORD. So therefore, I close up before I would get to use Close(0).

something like this:

I create the word application object reference
I massage some of the document from my object reference
I make WORD visible
I do some other things to the document from within WORD
I print the document from within WORD
The following code keeps word the active app and keeps vfp quiet



gHwndWord = GetForegroundWindow() && Save word window handle
Do while IsWindow(gHwndWord) # 0 && Wait while Word is alive
=inkey(.5)
Enddo

Then I quit word, THE WORD handle is gone and I kill the reference to WORD with

oWordDocument=.Null. && kill the beast and move on with vfp

Now, I QUIT word from within word by hitting the close button not from my WORD APPLICATION reference.
Therefore, I can't use close(0)


Any thoughts?

Neil








>Neil,
>
>Look in the vbawrdX help file, there is an optional argument to do this to the Close() I don't remember the method name off the top of my head method.
>
>>I have a place in my app where I enter WORD via automation. Because of some manipulations that I do to a document, WORD assumes that changes have been made and it prompts to save changes when I hot the close button. I don't want the prompt.
>>
>>Any body know how to close WORD, via hitting the close button, after making document changes without the save changes prompt?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform