I have a scenario which was working in OOO 2.*, but doens't seem to be working in OOO 3.*.
I have a code snippet which prepares data, uses a templates(*.doc) and replaces the data with the necessary contents. Once done the file is saved as *.doc.
Earlier(in OOO 2.*) the file was saving as expected and the header was aligned as displayed in the attachment ACTUAL_INTENDED.jpg. Now( in OOO 3.*) the header is getting misaliged as displayed in the image Erroneous.jpg. I can resolve the issue by saving the file as .odt and then convert into *.doc as opposed to directly saving as *.doc, but the file cannot be opened using Microsoft 2007. I get the following error "Word cannot start the converter mswrd632.wpc". Though that can also be resolved by deleting a registry entry, I do not wanna do that as many other windows based apps run on the machine and the after effects could be anything.
The file is being generated using a java code and have pasted the snippet below.
Code: Select all
XComponent document= doc.createDoc("***", templateDir+"/"+templateLocName,***,****,AsOfDate);
XStorable storable = (XStorable) UnoRuntime.queryInterface(XStorable.class, document);
PropertyValue[] properties = new PropertyValue[2];
PropertyValue p = new PropertyValue();
p.Name = "FilterName";
p.Value = format.getFormatCode();
properties[0] = p;
String loadURL = "file:///"+System.getProperty("*******")+"/"+fileName;
storable.storeToURL(loadURL, properties);
I need to find an alternative wherein the *.doc file gets saved without the header misalignment and also it should open using Windows 2007.
Can anyone who have faced the issue please help me out here..