Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Previewing in Word only
Message
From
13/07/2001 05:55:37
 
 
To
12/07/2001 10:37:17
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00528482
Message ID:
00530120
Views:
26
This message has been marked as the solution to the initial question of the thread.
>>First of all, if you want this just to restrict users editing of the document after preview, make the DOC file created by Word read-only, than open it in Word again and preview.
>
>This means we have to save a copy on disk. It'd like in VFP where all preview would go on disk. Too much management. :) I'd prefer another approach.
>
>>If you wand to close word immediately after preview closed... Well, you than need to find a way HOW distinguish from VFP the states of the Word to see if it is in preview mode or it is just in document editing state. I don't know how. However, if preview cuses modal state in the OLE Automation, than returning control to VFP is a sign of finishing of the preview mode and you can close the document from VFP. If this cause no modal state, than you require to check Word state in a loop and see if Word is still in preview mode...
>
>The way it is now, the control is immediately return to VFP after the preview has been initiated.
>
>After Word has opened the document, this is what we have:
>
>
>loWord.Visible=.T.
>loWord.ActiveDocument.PrintPreview
>
>
>I don't know if there would be such parameter we could pass in PrintPreview to do that.

Hi!
DECLARE integer Sleep in Win32API integer
loWord.Visible=.T.
loWord.ActiveDocument.PrintPreview
#DEFINE nLimitation 300
i = 1
do while loWord.PrintPreview AND i<=nLimitation && loop until we're in the print 
                     &&preview mode or time limitation reached
  sleep(1000)
enddo
loWord.ActiveDocument.CLose.....
.....
HTH.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform