We have a Win32 application that stitches together documents in Word via OLE from various fragments held in a database. There is a Word Template with a set of macros designed to ensure that the Word Document cannot be saved to disk but will be saved back to the database. So far, so good. Let us assume the system works.
We have readonly users too. The design is that a different template is used so these users may view documents. This ‘browser’ template has been brain-damaged so that no saving of the file may occur.
I have identified a very specific circumstance when this design fails – when a graphic falls inside a table, the readonly template dumps it outside the table, which results in a total reformat of the whole document – definitely NOT what is required.
By saving a sample document in xml format, once for each case, I have shown that ‘allowincell=false’ appears in the bad document for each affected graphic. It seems reasonable to suppose this is the culprit. The attribute is not mentioned at all in the good version. (Odd because MSDN states ‘false’ is the default value, at least in .NET)
It would help if I understood better the mechanism by which this value is being set. If I had to make a guess I would suppose that the attribute is set to True (i.e not mentioned) because the original user has requested so simply by placing the graphic inside a table.
Ultimately my question is – what is the MINIMAL intervention I can make to solve this specific problem ? Any suggestions as to how this might be approached would be most gratefully received.
It’s likely you may not have set
LayoutInCell = Truefor the image (along with itsWrapFormattowdWrapSquare,wdWrapThrough,wdWrapTightorwdWrapTopBottom). The default is always False and that translates to the VML of ‘allowincell=false” that you’re seeing. Again, make sure thatWrapFormatis notwdWrapNoneorwdWrapInline– just use one of the other ones above).If this doesn’t work, please supply us with more information. For example what version of Word? What is the “save” code for the brain-dead version. What “Save to Web Page” options are you using? Put a full and brain-dead version of the same document (redact as needed) in something like DropBox for us to examine.