Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Word OLE document - jump to a bookmark

Hello Everybody,

 

I’ve a problem with SWT OLE document (Word) :
I want open a word document in a container and directly jump to a bookmark. I used the following code:

 

        clientSite = new OleClientSite(oleFrame, 0, file);

        OleAutomation automation = new OleAutomation(clientSite);       

        int[] dispInfoGo = automation.getIDsOfNames(new String[]{"GoTo", "What", "Name"});

        int dispIdMember = dispInfoGo[0];

        Variant[] rgvarg = new Variant[2];

        rgvarg[0] = new Variant(-1); //what "wdGoToBookmark "

        rgvarg[1] = new Variant("test"); //Name

        int[] rgdispidNamedArgs = new int[] {dispInfoGo[1], dispInfoGo[2]};

       

        Variant result = automation.invoke(dispIdMember, rgvarg, rgdispidNamedArgs); 

 

The result is not null, but nothing happens. The cursor in the word document is still at the same position as before.

 

Can anybody help me?

 

Thanks, Franziska

 

 


Back to the top