Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to print a given page in Word
Message
De
18/05/2007 13:32:36
 
 
À
18/05/2007 11:41:07
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01226792
Message ID:
01226873
Vues:
16
Thanks for the tip Marcia. I did try your approach and it gave me this call:
loWord.ActiveDocument.PrintOut (1, 0, 4, "", 1, 999, 0, 1, "3", 0, 0, 1, "", "", 0, 0, 0, 0, 0)
Unfortunatly, it gave me a type mismatch error. I then tried this:
loWord.ActiveDocument.PrintOut (1, 0, 4, "", 1, 999, 0, 1, "3")
But I still receive a type mismatch error. This code doesn't give me an error, but it still print the whole document:
loWord.ActiveDocument.PrintOut (, , 4, , , , , , "3")
>And here are the steps that you can use to translate the VBA into VFP:
>1. Add parentheses around the parameter list
>2. Examine the calling prototype for the method in the object browser and rearrange the parameters in the generated macro so that they appear in the same order that they are listed here. Because VBA uses named parameters, their order does not matter. This is not so in VFP where parameters are positional. Regardless of the order of the parameters in the VBA macro, the Object Browser and IntelliSense always display them in the order required for correct Visual FoxPro syntax.
>3. Remove the names of the parameters on the left side of the ‘:=’ as well as the ‘:=’
>4. Replace the named constants with their values. This includes replacing True with 1 and False with 0. Note: An alternative would have been to add #DEFINE statements at the top of the method like this after looking up the values for the named constants in the Object Browser:
>
>#DEFINE TRUE 1
>#DEFINE FALSE 0
>#DEFINE WDOPENFORMATAUTO 0
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform