Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Naming word documents
Message
De
15/09/1997 16:15:42
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00050126
Message ID:
00050141
Vues:
25
>>>i'm dynamically creating some word documents using word basic.
>>>i can add all my text with formatting etc. but i just can seem to find a way to name my file.
>>>anyone know how to do it?
>>>thanks
>>
>>Gray,
>> here is sample code that I use in Word 95...
>>
>>* Build filename to create in Word from template file
>>
>>lcFilename = oWWH.wordata_path+header.exch+"\"+TRIM(header.wonbr)
>>
>>oWord = CREATEOBJECT("Word.Basic")
>>
>>WITH oWord
>>
>> .AppShow && Makes Word Visible
>>
>> .AppMaximize(1)
>>
>> .FileOpen(lcMergefile)
>>
>> .StartOfDocument()
>>
>> .FileSaveAs(lcFilename)
>>
>>... More code follows
>>
>>ENDWITH
>>
>>Hope this helps..
>>
>>PS: You should look into the new version of Word, supposedly it is easier than using Wordbasic, since it is using VBA...
>>
>>Thanx!
>>
>>Tony Miller
>>PTI, Vancouver, Wa
>
>thanks tony, it worked great. the only problem is that word is still in memory. any clue how to release it.
>i released the object and word is still open and i tried release all close all etc even quitting foxpro only to have winword still in the task manager.

Gray,
Somewhere under the WITH, do the following:
.Fileexit()

This will exit out of word for you....

Sorry about that.. I have the people here manually exit out of word, since they are entering in text into the document after I build the basic structure for them..

Thanx!

Tony Miller
Vancouver,Wa
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform