Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Opening existing Word doc in OLE container control
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00256395
Message ID:
00256449
Vues:
39
Hi Paul,

Well, that does get rid of the error. But the OLE container displays a blank document. I am pretty sure the document is in fact open because I can see the temporary file that Word creates when it is editing a document.

I did try the different values for the DoVerb method.

Any ideas?

My code is now:
thisform.addobject('loWordDoc','olecontrol','word.document')
thisform.loWordDoc.Height = thisform.height
thisform.loWordDoc.Width = thisform.width
thisform.loWordDoc.Top = thisform.top
thisform.loWordDoc.Left = thisform.left
thisform.loWordDoc.Visible = .t.
loWord = thisform.loWordDoc.Object.Application.Documents.Open('c:\awork\brouter.doc')
thisform.loWordDoc.DoVerb(0)

Thanks!


>Vern:
>
>Also, in W2000 you need to set the application object visible.
>
>thisform.loWordDoc.object.application.visible = .t.
>
>HTH,
>
>--Paul
>
>>Vern:
>>
>>Try calling your Open method first before the DoVerb.
>>
>>--Paul
>>
>>>>I would like to open an existing MS Word document on a VFP form to provide a crude help file for my application. If possible I would like the users to be able to basic Word functionality like Find and Print.
>>>>
>>>
>>>I believe I am a little closer. I am now using the following code:
>>>thisform.addobject('loWordDoc','olecontrol','word.document')
>>>thisform.loWordDoc.Height = thisform.height
>>>thisform.loWordDoc.Width = thisform.width
>>>thisform.loWordDoc.Top = thisform.top
>>>thisform.loWordDoc.Left = thisform.left
>>>thisform.loWordDoc.Visible = .t.
>>>thisform.Show
>>>thisform.loWordDoc.DoVerb(0)
>>>loWord = thisform.loWordDoc.Object.Application.Documents.Open('c:\awork\brouter.doc')
>>>
>>>I am now geting the following error message:
>>> The open method or property is not available because this document is being edited by another application.
>>>The file is not open by another application.
>>>
>>>It is interesting to note that I get the same error message if I supply the name of a file that does not exist.
>>>
>>>Any ideas?
>>>
>>>Thanks!
Vern
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform