Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word from VFP, sending values (correction to prev)
Message
From
01/03/2000 11:57:13
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
01/03/2000 11:26:11
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00339855
Message ID:
00339886
Views:
35
>I need to print Mailmerge letters from VFP, sending the DBF to use, All OK.
> I have ceratin information that is constant for all letters of this run,
> but vary by run, such as dates, contact person, etc.
> I would like to not have to add this info to the DBF i am sending
> and I would not want that WORD should prompt for this info.
>
> Can I set a fillIn or bookmark, WORD should NOT prompt for this info,
> But at run time I would pass this information.
>
> Thanks
> Shlomo.


You could have variable fields in word and set them from VFP. To set them you would use (it doesn't ask - DOCVARIABLE "VarName" \* MERGEFORMAT - created with Insert\Fields\Document Automation\DocVariable) :

_SetVar("myVar","Some Value")

FUNCTION _SetVar
LPARAMETERS tcVarName, tcVarValue
.Variables(tcVarName).value = iif(empty(tcVarValue)," ",tcVarValue)

Also you could use bookmarks :
with toWord.ActiveDocument
  .Bookmarks(tcBookmarkName).Select
  WITH toWord.Application.Selection
     .Collapse(wdCollapseEnd)	&& Go to end of bookmark
     .Text = "Whatever text"
...
But personally if they're constant per run I wouldn't even keep a template and write "whole letter" on the fly from VFP or I would choose the option to have them as mergefields also.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform