Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A word document in a general field
Message
 
 
À
18/06/2002 04:15:59
Dino Liberale
Ministero Lavori Pubblici
Trieste, Italie
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00669088
Message ID:
00669686
Vues:
13
>>>How to mantein inalterate layout as I copy from Word ?
>>>There are other solution to mantain docs without files ?
>>>
>>use FILETOSTR() and strtofile(
>>)
>>important ... store filetostring conversion in a binary memo field not a general field
>>
>>ldoc=FILETOSTR(word.doc)
>>repl (yourdbf.binmemo) with ldoc
>>
>>strTOfile(yourdbf.binmemo,'thisdoc.doc',0)
>>
>>RonL
>
>Ok This is the right way for me,
>
>I understand the process of extraction from memo and file .doc generation
>using:
>strTOfile(yourdbf.binmemo,"F:\Documents\xyz\mydoc.doc",0)
>
>then open the document by automating word somethink like:
>oWord = CREATEOBJECT( "Word.Application" )
>oWord.Documents.Add("F:\Documents\xyz\mydoc.doc")
>etc. ...
>but now the user make changes ... and now the question !
>Is it possible to automate saving process when document close or other ?
>
>Thanks a lot.

You can set up a timer class that is enabled when the document is opened, then poll for instance of this document and run your code and disable the timer when the instance ceases to exist.

example: ABC.doc
lcdocname="ABC"
&& Declare API function
DECLARE INTEGER FindWindow IN Win32API;
STRING @lpClassName, ;
STRING @lpWindowName
lcApplicationTitle =lcdocname+ " - Microsoft Word"
x = FindWindow(0, @lcApplicationTitle)
if x=0 && application is closed ... no handle
&& do your code and disable timer
endif
x also equals th numeric handle for the window ... you can use macro expansions here

If you need more help ... email me
Ronl
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform