Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert Word macro to code
Message
From
07/10/2008 17:39:00
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
07/10/2008 17:25:02
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01353435
Message ID:
01353492
Views:
29
>I was just a bit premature on that gold star. I did get an error at:
>
> FOR EACH oDoc IN oWord.Documents
> .Close(.f.)
> ENDFOR
>
>...so, as a rebel, I just commented that part out. LOL
>
>It ran fine, but couldn't close Word until I manually told it I did not need to save my changes. I'm confident you know how to tell it NO and to just close.
>
>Still grateful,
>Martha

I can assure you he knows:) Here it is FYI:
* instead of oWord.Visible = .t.

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

oWord.Quit( wdDoNotSaveChanges )
However if you attempt to quit while it is already printing you would get an error, for that reason check if it finished before attempting to quit:
declare Sleep in win32API integer dwMillis
do while oWord.BackgroundPrintingStatus > 0
  Sleep(500)
enddo
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