Embedding OLE object

Started by ziko, May 13, 2010, 04:33:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ziko

When I use ole.DoVerb(vbOLEShow) Visio doesn't embed perfectly in the OLE,
how can I adjust it to have the same size as the OLE object?

Thank you,
Ziko

JuneTheSecond

Did you checked Application.DoCmd visCmdEditOpenObject ?
Best Regards,

Junichi Yoda
http://june.minibird.jp/

ziko

I will give it a try,
Does this command opens the embedded visio to the same size of the OLE?
Thank You,
Ziko

ziko

The DoCmd vixCmdEditOpenObject didn't actually work, it returned an error that the requested operation is presently disabled.

I also have another problem when embedding visio in an OLE is that when I click on a button on my form visio closes, which is fine but it is running in the background. How can I make sure it completely shut down? Cause now I need to delete the task from the task manager.

Thank You,
Ziko

JuneTheSecond

"The requested operation is presently disabled" pops up when the particular shape is not selected.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

ziko

I don't think you understand my question.
I am using VB to embed visio in an OLE using the code:ole.DoVerb(vbOLEShow)
Problems:
1- When visio opens in the OLE it didn't resize properly and get the same size as the OLE object.
2- After clicking on a button on the VB form visio get unloaded but it still running in the background, I have to create go kill the process manually from the task manager.
Maybe I didn't know how to use the DoCmd vixCmdEditOpenObject you suggested.
Thank you I really appreciate your help,
please keep the thoughts coming I really need to fix these two critical issues very soon

ziko

Issue #2 is fixed. in the lostFocus event or when the form is closing we have to shut down the object contained in the OLE object:If ole.AppIsRunning Then
        Call ole.object.Close
    End If

Now I still need to fix the resize problem, when visio embeds into the OLE.

ziko

The answer to have visio or any object embedded correct in an OLE object is to set this property:
OLE.SizeMode = vbOLESizeStretch
or vbOLESizeStretch
or vbOLESizeAutoSize ...