Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word OLE and VFP General fields
Message
De
01/11/1999 04:05:36
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
30/10/1999 17:35:48
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00266421
Message ID:
00284683
Vues:
18
Hi Trish,
You could do with a lengthy operation. You extract the contents to a doc file first. Copy one record to another table, open fpt lowlevel, strip first 599 bytes (header info) and name it with a .doc extension. When editing done get data back with "append general".
Otherwise you have to use an oleboundcontrol. In any case, in fact you're using the word object.
A general field is another type of binary memo field. VFP knows it would be opened with a server app. Other than that it's same as another binary memo field.
I tend to save "general" as external files and in table keep their name&path. This has the advantage of preventing fpt bloating if they're edited frequently. OTOH has the disadvantage of having numerous files in a directory.
Cetin


>I understand how to access the general field. Do you HAVE to use an OLEBOUNDCONTROL? If so, I can't seem to close word when I'm done.
>
>Can I just use a WORD OBJECT and access the general field?
>
>Trish
>
>>>Using OLE commands from VFP to "control" Word is no problem. I have an application that uses documents stored in a general field of a VFP table. I have no problem initiating an edi session with Word for the document, but at times, I would like to reference the Word application object.
>>>
>>>Is there any way to take the document stored in a general field and be able to control Word as though full OLE automation was being used? If this is not possible, is there a way to take the document stored in the general field and move it to a temporary ".DOC" file?
>>
>>
Al,
>>It doesn't matter if you instantiate word with createobject or it's an object bound to a general field.
>>
>>with thisform.OLEWord.Object.Application
>>*.....
>>endwith
>>
>>
CREATE cursor wtest (wf g)
>>APPEND blank
>>APPEND general wf from ("c:\my documents\test.doc")
>>oform = createobject("form")
>>WITH oform
>>  .addobject("olbW","Oleboundcontrol")
>>  .height = 420
>>  .width = 620
>>  WITH .olbW
>>    .top = 10
>>    .left = 10
>>    .height = 400
>>    .width = 600
>>    .controlsource = "wtest.wf"    		&& Embedded word doc
>>    #DEFINE wdSeparateByTabs  1
>>    #DEFINE wdTableFormatColorful1 8
>>    #DEFINE wdSaveChanges  -1
>>    #DEFINE wdCollapseEnd  0
>>    SELECT first_name, last_name ;
>>      from (home()+"samples\data\employee") ;
>>      into cursor myCursor
>>    Application.datatoclip("myCursor",_tally, 3)
>>    WITH .object
>>      .Content.select
>>      WITH .Application.Selection
>>        .Text = "Hello from VFP."+chr(13)
>>        .Collapse(wdCollapseEnd)	&& Go to end of selection
>>        .Text = _cliptext
>>        .ConvertToTable(wdSeparateByTabs,,,, ;
>>          wdTableFormatColorful1,,,,,,,.f.,,.f.)	&& Convert to table format Colorful 1
>>      ENDWITH
>>      .saveas("c:\temp\savedfromgen.doc")  && saved to disk
>>      .close(wdSaveChanges)
>>    ENDWITH
>>    *	.visible = .t. && If you want to display the form
>>  ENDWITH
>>  *	.Show	&& If you want to display the form
>>ENDWITH
>>*READ EVENTS	&& Start event processing - not needed if just process the word object and close
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
Répondre
Fil
Voir

Click here to load this message in the networking platform