|
Re: Ole Word Scrollbar [message #442707 is a reply to message #442509] |
Sun, 12 September 2004 19:41 |
Eclipse User |
|
|
|
Originally posted by: dwojtas.myrealbox.com
Jérôme Calafat wrote:
> Hi,
>
> I am using Eclipse 3.0. I made an RCP application and i want to include a
> viewer which opens Word and Excel documents in a view .
> I manage to open these documents but i don't get the Horizontal and
> Vertical Scrollbars.
> Here is a part of my code:
> //parent is a composite
> frame = new OleFrame(parent, OLE.V_SCROLL | OLE.H_SCROLL );
> site2 = new OleClientSite(frame, SWT.NONE , nomFichier);
>
> frame.layout();
> parent.layout();
> site2.doVerb(OLE.OLEIVERB_SHOW);
>
> I can see the Scrollbars but they are not binded to the document.
> How can i do that?
>
> Thanks in advance,
>
> jérôme
Hi,
Don't know if it helps, but you might look at the class
org.eclipse.ui.internal.editorsupport.win32.OleEditor
and this code snippet, Word specific:
Darek
----
private void handleWord() {
OleAutomation dispInterface = new OleAutomation(clientSite);
// Get Application
int[] appId = dispInterface.getIDsOfNames(new
String[]{"Application"});
if (appId != null) {
Variant pVarResult = dispInterface.getProperty(appId[0]);
if (pVarResult != null) {
OleAutomation application = pVarResult.getAutomation();
int[] dispid = application.getIDsOfNames(new String[]
{"DisplayScrollBars"});
if (dispid != null) {
Variant rgvarg = new Variant(true);
application.setProperty(dispid[0], rgvarg);
}
application.dispose();
}
}
dispInterface.dispose();
}
|
|
|
Powered by
FUDForum. Page generated in 3.39929 seconds