Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word from VFP, sending values (correction to prev)
Message
De
01/03/2000 11:57:13
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
01/03/2000 11:26:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00339855
Message ID:
00339886
Vues:
34
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform