Protecting an embedded Word Document

M

M. Burkhart

Hi

I'm opening an embedded word document in a Java application using
OleClientSite from the org.eclipse.swt package. I want to be able to
protect the document, so it can't be edited by the user.

When I call the "ActiveDocument.Protect" method on the automation object
I get a DispatchException: "The interface _Document does not have the
Property named Protect. [The Protect Method is not available for this
object because the document is edited in an other application]"

I found a similar thread by Scot T. Brennecke ("Make embedded Word
document read-only, Using Automation") posted 2002-05-10. The differece
to Scots problem is, that I can't even turn protection on in the menu
(it is disabled).

Here is how I instantiate the OleClientSite:

_site = new OleClientSite( _frame, SWT.READ_ONLY, "Word.Document",
_template);
_site.doVerb( OLE.OLEIVERB_SHOW );

When I use OLE.OLEIVERB_OPEN (Word opens in a separate window) instead
of OLE.OLEIVERB_SHOW, protection works just fine.

Why does Word make a difference between embedded-mode and
standalone-mode? Is this behaviour a bug or a feature?

Thanks in advance.
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top