Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP-Word2K - Create DocVariable in a template file
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00761396
Message ID:
00762112
Views:
58
What do you mean, "I was not able to create and place variables from Word"?
You can gather variables defined in the document and pass them to your program:

dime aVariablesfromWord[.ActiveDocument.Variables.Count,2]

for ia=1 to .ActiveDocument.Variables.Count
aVariablesfromWord[ia,1]=.ActiveDocument.Variables(ia).Name
aVariablesfromWord[ia,2]=.ActiveDocument.Variables(ia).VAlue
endfor


>Yes thanks Yuri I can create variables programatically but I want the users to be able to place the variables (I can create the basic DOT file with variables before hand if required) but I was not able to create and place variables from Word.
>
>>Something like this:
>>
>>* add variables
>> .ActiveDocument.Variables("Client.ICID").Value=23
>> ?.ActiveDocument.Variables.Count
>> ?.ActiveDocument.Variables(1).Name
>> ?.ActiveDocument.Variables(1).Value
>>>Hi
>>>
>>>I have to create a Word Doc Template. This template is supposed to allow the user to put in predefined fieldnames, names that the VFP automation program expects from this template.
>>>
>>>Q1. How and Where to define DocVariables in a template file?
>>>Q2. How to put these DocVariables (not it's value) in the template file?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform