Problem in Visio OleAutomation

View: New views
1 Messages — Rating Filter:   Alert me  

Problem in Visio OleAutomation

by shahid :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All!

I am using oleautomation for visio and able to open visio, but unable to set a blank document.

My actual code is as following:
//***************************************************************************
clientSite  = new OleClientSite(oleFrame, SWT.NONE, "Visio.Drawing");
this.clientSite.doVerb(OLE.OLEIVERB_OPEN);
this.dispInterface  = new OleAutomation(clientSite);
this.application    = getProperty(this.dispInterface, "Application").getAutomation();//This line throws exception.
documents = getProperty(application, "Documents").getAutomation();

public Variant getProperty(OleAutomation automation, String strPropName)
{
int[] rgdispid1 = automation.getIDsOfNames(new String[]{strPropName});
int dispIdMember1 = rgdispid1[0];
Variant variant = automation.getProperty(dispIdMember1);
return variant;  
}
//****************************************************************************

Could anyone provide any help regarding this or code snippet will do the best? Thanks.

Regards,
Shahid