OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Control Embedded OLE Object in ooWriter with VB

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Patxi
General User
General User


Joined: 25 Oct 2006
Posts: 8

PostPosted: Mon Oct 30, 2006 5:43 am    Post subject: Control Embedded OLE Object in ooWriter with VB Reply with quote

Hello,

could somebody tell me how to control an embedded OLE Object in ooWriter?
(for example: I have a graph which I can 'refresh')

I embedded the OLE-Graph in the *.odt file and want to fetch it from a VB6 application.
I tried it like this:

Code:
'Dim ...,... as Object

Sub main

  Set ooSM = CreateObject("com.sun.star.ServiceManager")
  Set ooDesk = ooSM.createInstance("com.sun.star.frame.Desktop")
  Set ooDoc = ooDesk.loadComponentFromURL("file:///c:\test.odt, "_blank", 0, args())

   For i = 0 To ooDoc.embeddedObjects.Count - 1
     If ooDoc.embeddedObjects.getByIndex(i).clsid = "4F353242-63C6-11D5-a906-11201802ff89" Then
       Set ooEmbeddedGraph = ooDoc.embeddedObjects.getByIndex(i)
       
      'FROM HERE ITīs propably wrong!?
       Set graph = ooEmbeddedGraph.EmbeddedObject
       graph.refresh '<<<< DOES NOT WORK

      End If
   Next i

End sub


In Mircosoft Word it works like this ( the graph is a SHAPE):
Code:
Set Graph = Shape.OLEFormat.object
Graph.refresh


So does anybody knows what I do wrong or how i can access the OLE-Objects API?

Thanks for help,
Patxi
Back to top
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Mon Oct 30, 2006 10:13 am    Post subject: Reply with quote

Best way is perhaps to try with OOoBasic and XRay.
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
ms777
Super User
Super User


Joined: 07 Feb 2004
Posts: 1355

PostPosted: Mon Oct 30, 2006 10:15 am    Post subject: Reply with quote

in OO it seems to be much more difficult ... see e.g. http://www.oooforum.org/forum/viewtopic.phtml?t=21131 .

What kind of object is embedded ? Can you post your doc somewhere ?

Greetings,

ms777
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group