Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word Constants?
Message
De
16/09/1999 12:46:06
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
16/09/1999 11:49:22
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Divers
Thread ID:
00265502
Message ID:
00265527
Vues:
21
>Is there an *.h file with all the constants that Word2000 uses. Also is there any good books on OLE Automation of particularly Word or the entire Office Suite. I am trying to create a Word *.Doc of a quotation, with data from VFP5.0, that can be attached to an E-mail and sent to the respective party. I am having a heck of a time trying to figure out how to move around in Word. I just want to do some basic formating, like set some tabs and change some font sizes. I just can't seem to figure out how to control the "Insert point" very well. Any guidance would be much appreciated
>
>Thanks in Advance.
>
>Jon


There is no mention about a difference in header files of w97 and w2000 in MSDN lib. w97 constants should be in files section. Help file is ...\Microsoft Office\Office\vbawrd8.hlp for w97.
Understanding insertion point is a challenge :) But not only that if you go that way. It would be slow too (VBA).
Instead create a template in word with formatting as you want. Instead of hardcoded text use fieldcodes. ie: insert fields :
DOCVARIABLE "cFirst_name" \* MERGEFORMAT
DOCVARIABLE "cLast_name" \* MERGEFORMAT
and do any formatting in word. Then uncheck tools\Options\Field codes if checked.


from VFP all you have to do is :
oWordDocument = createobject("Word.Application")
with oWordDocument
  .Documents.Add("c:\mypath\mysavedtemplate.doc") && New file with a template
  with .Activedocument
    _SetVar("cFirst_Name", myTable.First_name)
    _SetVar("cLast_Name", myTable.Last_name)
*...
  endwith
*...
 .Visible = .t. && Show word
endwith


FUNCTION _SetVar
LPARAMETERS tcVarName, tcVarValue
 .Variables(tcVarName).value = iif(empty(tcVarValue)," ",tcVarValue)
This works pretty well for one record templates (or Parent table data).
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