Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Editing in word object
Message
 
To
25/09/2006 12:38:52
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01156616
Message ID:
01157001
Views:
20
I know I can do that, but using CREATEOBJECT("word.application") I can not have a "preview" of the document in my form.
I used OleBoundControl just because it was an object I can put in my form to have a "preview" of the document while I navigate in my Grid.

>You must go back to the drawingboard, and completely forget the "old" way. In stead you use automation, something like
>strtofile('yourmemofield','c:\temp\yourtempfile.doc')
>ox=createobject('word.application')
>ox.Documents.Open('c:\temp\yourtempfile.doc')
>ox.Visible= .T.
>ox.activate()
>*** Now word is open, and the user can edit and save the document
>ox.quit()
>replace yourmemofield with filetostr('c:\temp\yourtempfile.doc')
>
>
>
>>I am trying this solution (memo binary, using APPEN MEMO and COPY MEMO TO FILE) but I don't know how to show the document in my OLEBoundControl object.
>>
>>
>>>If you search for general field here at UT, you can read about all the problems people have with them. One of the small problems is that the size of the field is many times bigger than the document which is stored, so you can very soon reach the 2GB limit. Another problem you is when you later want to get the data out of the table, and you don't have the associated program avaliable. Personally I call a general field a FINO (first in never out), or a WROM (Write only mery).
>>>
>>>If you must store the documents inside the table, use binary memo fields, and copy the fields to/from temp files on disk for editing purposes.
>>>
>>>>Mmmm... I wanted to do that in a first time, but I can have more than 300,000 people in my database, with 0 to x ducoments (word, excel and PDF) Genaral fields appears to me to be a good idea (but it seems it is not the best one)
>>>>
>>>>
>>>>>Simple, store the documents as regular files, and only store the filename, with or without path, in your table.
>>>>>
>>>>>>Thanks for your word of caution, but what can I use instead od General fields ? (First I have to manage Word document, but next I have to manage also Excel and Acrobat documents
>>>>>>
>>>>>>>First one word of caution: Avoid general fields AT ALL COST! It seemed like a good idea, but experience has shown that a general field is just another word for trouble!
>>>>>>>
>>>>>>>For you question, I suggest that you check out Microsoft Office Automation with Visual FoxPro at http://www.hentzenwerke.com/catalog/autofox.htm
>>>>>>>
>>>>>>>>Hi,
>>>>>>>>
>>>>>>>>I am using a word object in my form to edit documents saved ina General field.
>>>>>>>>
>>>>>>>>i use this to create my object
>>>>>>>>Thisform.addobject('oWord',"OleBoundControl")
>>>>>>>>Thisform.oWord.ControlSource = "tabletest.Remarque"
>>>>>>>>
>>>>>>>>I change the AutoActivate property to 1, so, when my object get the focus, it turn to editing mode.
>>>>>>>>
>>>>>>>>Is it possible to change properties like zoom, hide word's rulers or word's toolbar, ... ?
>>>>>>>>
>>>>>>>>Where can I find a good documentation on word automation (especialy, managing the word inetface like menus, toolbar, right-click...)
>>>>>>>>
>>>>>>>>Thanks
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform