Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word Print Services
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00863509
Message ID:
00863587
Vues:
11
Gerald,

You may start with this:
oWord = getOBJECT(,"Word.Application")
oWord.activate
oWord.ActiveDocument.printpreview()

* Disable bars as neeeded
=iSetWordBars(.f.)

do while "preview"$LOWER(oWOrd.ActiveWindow.Caption)
	WAIT WINDOW TIMEOUT 1.0 "Close Word Print Preview  to continue..."
enddo

* Enable bars
=iSetWordBars(.t.)

=messagebox('Press Ok to continue')

oword=.null.
*-----------------
PROCEDURE iSetWordBars
LPARAMETERS plValue

oword.CommandBars("Menu Bar").Enabled = plValue

*alternatives/additions are like:
*oword.CommandBars("Menu Bar").Controls("File").Enabled = plValue
*oword.CommandBars("Menu Bar").Controls("Edit").Enabled = plValue
*oWord.CommandBars("Standard").Enabled = plValue
*oWord.CommandBars("Formatting").Enabled = plValue
>Yuri, I have just about everything working I need within the document, what I've run up against is an easy way of doing a print preview...here's what I have in simple form...
>
>loObject = createobject('word.application')
>loDoc = loObject.Documents.Add()
>with loDoc
>*- do stuff with document
> .printpreview()
>endwith
>loObject.visible = .t.
>=messagebox('Press Ok to continue')
>loObject.visible = .F.
>*- Cleanup doc here
>return
>
>
>all is fine if the user goes back to VFP and clicks ok, but if the user clicks close print preview, they are put into the actual word document ready for editing.. not good.. and if they close that window object reference is lost then.. not good..
>
>what would be optimal is the doc is brought up in print preview, no additional message box needed to "halt" vfp, and when the users closes the print preview via the button or the window "x", vfp would regain control and complete the clean up as needed.
>
>I've been all thru everything that I can find on event binding, and when I export word's events out, there is not an obvious method to do the intercept at, hence the reason I asked if the print preview window could be sent to a vfp form.. just looking for the easiest way to do this..
>
>
>TIA
>Gerald Parish
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform