| View previous topic :: View next topic |
| Author |
Message |
Patxi General User

Joined: 25 Oct 2006 Posts: 8
|
Posted: Mon Oct 30, 2006 5:43 am Post subject: Control Embedded OLE Object in ooWriter with VB |
|
|
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 |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
|
| Back to top |
|
 |
ms777 Super User


Joined: 07 Feb 2004 Posts: 1355
|
|
| Back to top |
|
 |
|