I have a WebStart application that embeds a Word container to allow the user to use mail merge and then save the document back to a database.
The problem I have is when I try to load an existing document using the container.load(byte[]) method.
The actual call appears to work fine and is called within an olemessageloop as follows:
container = new OleContainer();
// check to see if a document has already been created
byte[] existingDocument = getDocument();
if(existingDocument != null && existingDocument.length > 0)
{
mContainer.load(existingDocument);
}
However, when I try to show the container as below:
app.container.doVerb(OleVerbs.SHOW);
it throws the following exception:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: OleObject is not created.
Creating a new document and opening a file is no problem. The only problem is when I try to use the load method using a byte array.
Any ideas??
Thanks
Nick