Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Preprocessor Directors and Macro Substitution
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Preprocessor Directors and Macro Substitution
Miscellaneous
Thread ID:
00235018
Message ID:
00235018
Views:
47
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
Next
Reply
Map
View

Click here to load this message in the networking platform