Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CLOSING MS WORD WITHOUT PROMPTING TO SAVE CHANGES
Message
 
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00343803
Message ID:
00344047
Views:
22
Neil,

Here's the constants I was thinking about:

* WdSaveOptions

#define wdDoNotSaveChanges 0
#define wdSaveChanges -1
#define wdPromptToSaveChanges -2

If you are closing Word from Word itself you may have to use a macro/vba script on that side to trap the close and do it without save. You might also be able to set some kind of a document level property to not save it. You'll have to check the vbawrd help file.

>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)
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform