Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word97
Message
De
03/08/1998 12:19:51
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
03/08/1998 11:00:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Word97
Divers
Thread ID:
00123542
Message ID:
00123568
Vues:
23
>Hello,
>
>I have a problem with OLE automation to Word. I have an existing .dot file with unknown number of bookmarks. I try to find out the names of the bookmarks and replace them with the apropriate data. Behind the bookmarks should be the variables (identical with the fields in in my VFP table) and expressions combining these variables. It is functioning well with the single variables. But I can not find out the content of a bookmark where there is an expression. Can somebody help me further? I would appreciate any help - I am quite new with OLE.
>
>Milos Klas
Hi Milos,
There is a bookmarks and variables collection. To set all variables to field contents (var names match with fields as you said) :
cMyTable = "mytablename"
oWord = createobject("word.application")
with oWord.activedocument
  for ix=1 to fcount(cMyTable)
      .variables(field(ix,cMyTable)).value = eval(field(ix,cMyTable))
  endfor
endwith
And similarly bookmarks collection can be controlled as :
cMyTable = "mytablename"
oWord = createobject("word.application")
with oWord.activedocument
  for ix=1 to fcount(cMyTable)
      if .bookmarks.exists(field(ix,cMyTable))
         .bookmarks(field(ix,cMyTable)).select
         oWord.selection.insertafter(eval(field(ix,cMyTable)))
      endif
  endfor
endwith
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform