Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Preprocessor Directors and Macro Substitution
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Preprocessor Directors and Macro Substitution
Divers
Thread ID:
00235018
Message ID:
00235018
Vues:
48
After veiwing a session with Word and Excel at the recent Developers conference. I decided I would implement some word automation. Using VFP 6.0 with SP3.

I'm using the word.h file found on the Foxpro Devcon CDRom. (dev04\examples)

Scenerio:

As an example I have the following Word Basic syntax stored in a FoxPro memo field.

Selection.WholeStory
Selection.Font.Size = 20
WindowState = wdWindowStateMaximize
ActiveDocument.PageSetup.LineNumbering.Active = .F.
ActiveDocument.PageSetup.OddAndEvenPagesHeaderFooter = .F.
ActiveDocument.PageSetup.DifferentFirstPageHeaderFooter = .F.

I'm reading each line of code using mLine() and Memline() and executing macro substitution as follows:

lcVBACode = "loWord." + alltrim(lcMemLine)
&lcVBACode

All the word Basic code runs find except any word basic code which includes a preprocessor directive i.e. wdWindowStateMaximize. I receive an error message stating the variable "wdWindowStateMaximize" is not found.

I have tried using #include word.h, #Define wdWindowStateMaximize 1. Nothing seems to work with macro substitution.

However, if I implemented the following code, it would work.

lcVBACode = "loWord.WindowState = " + alltrim(str(wdWindowStateMaximize))
&lcVBACode

Any help would be appreciated.


David Ginn
DNA Computing, inc.
410-625-9514
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform