Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » [OLE,SWT] Calling propertys from ms word documents
[OLE,SWT] Calling propertys from ms word documents [message #436025] Sat, 08 May 2004 19:30
Eclipse UserFriend
Originally posted by: rene.bruenjes.nexgo.de

Hi Newsgroup,

i am trying to find out some values from an MS Word Document (is it write protected, number of form fields something like that,
using the type library and the
eclipse corner article :"ActiveX Support In SWT" .
To find out the applicable methods for "Word.Document" i used "Snippet81"
available in the eclipse help corner section.

I am new to the SWT and OLE stuff and the given tutorial examples left me with
error messages like :

java.lang.NullPointerException

or wrong values.

By the way the word document is correctly shown in the ole frame,so far its working well.
In view of the above questioned values i built a new word form document including some form fields and applyed the "ms word document
password protection".
Also i used the following code samples:

File file = new File("C://Documents/MyTestDocument.doc");
OleClientSite clientSite = new OleClientSite(frame, SWT.NONE, file);
OleAutomation automation = new OleAutomation(clientSite);
int[] rgdispid = automation.getIDsOfNames(new String[]{"FormFields"});//or :HasPassword or:ReadOnly or:FormFields and s.o.

int dispIdMember = rgdispid[0];//sometimes causing the NullPointerExceptions
Variant result = automation.getProperty(dispIdMember);
System.out.println("The value is: "+result.getString());

In general i wonder if there's a way to do things like these (including setting a new password ) with the swt/ole classes. It should
work according the information in the
tuorials.
Short code samples would be nice and helpful .

In advance ,please forgive me when i am totaly wrong with this due to my translation of the tutorials nor my java knowledge ;-)

Thanks
Rene
Previous Topic:TableTree + CHECK + gtk = ouch
Next Topic:support for headless ActiveX controls
Goto Forum:
  


Current Time: Fri Apr 19 20:58:17 GMT 2024

Powered by FUDForum. Page generated in 0.03960 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top