Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Open existing word document from foxpro.
Message
 
À
02/11/1999 16:59:39
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00285578
Message ID:
00285861
Vues:
18
>i not able to create my field in word, i not sure how to create my propertie.
>what i understand is 1- i go to file - properties
> 2- i define a variable - jfb with something in value.
> 3- i go to insert menu - field and insert my new field.
>
>Sorry if my menu description of word is not exact, but i have some trouble to translate, i have a french word.
>
>when i run my foxpro application i have the error -
>
>OLE dispacht exection code 0 from word - collection member not existing.
>
>This is my foxpro code.
>
>oWord = createobj("word.application")
>oWord.documents.open('e:\data\ssamta20\test01.doc')
>oWord.activedocument.Formfields("jfb").result = "my test01"
>oWord.visible = .t.

If you go to Word View/Toolbars menu, check Forms toolbar in the list. When you have Forms toolbar - the first button is "Text Form Field". Click on it and it will insert the grey empty field in your text. Then click on fourth button from the toolbar left - "Form Field Options", and enter the default text for this field (This text will be replaced with your variable value from the VFP). Under Field Settings there is a Bookmark. That is the field name in the FormField collection. You can replace it with your "jfb" name.

Then the line

oWord.activedocument.Formfields("jfb").result = "my test01"

will work.

Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform