Incorrect handling of Word 2007 document property data formats

P

Peter Karlström

Hi

I'm developing a COM-Addin in VS2008 for Word 2007 with SP2.
We have discovered a strange error which affects the presentation of
CustomDocumentProperties data in the document.

This error is easy to reproduce and I suspect this is (yet) another Word
2007 bug.

1. Start Word 2007 with a blank document
2. Add a custom document property and give it a value
3. In the page header, insert a 1 cell table
4. Format the cell to Arial 12 points, bold
5. In the cell, insert a field referens to your property with Insert - Field
6. Notice correct value and format
7. Save and close the document.
8. Open the document and add som text to the value of your property
9. Printpreview.
10. Notice the incorrect format of the field data from the start of your
added info

Now, why is this?
If I look inte the XML-part in an unpacked document, in header1.xml off the
document, there is a lot of "preserve" statements among the tablecell
information
and the added value seems "misplaced" in the XML-tags.

Is this a know bug, or does anybody know a useful workaround?

Thanks in advance
 
J

Ji Zhou

Hello Peter,

When I follow your steps in my side, I can reproduce the issue. After some
further investigation, I found if I unchecked the box "Preserve formatting
during updates", the issue did not appear. So it is controlled by the option
"Preserve formatting during updates".

Could you please give it a test in your side that if you uncheck this
option, do you see the new added value in correct format(Arial Bold 12)


Best regards,
Ji Zhou - MSFT
Microsoft Online Community Support
 
J

Ji Zhou

Sorry for not mentioning that the option "Preserve formatting during
updates" appears in the dialog when we add the field.



Ji Zhou said:
Hello Peter,

When I follow your steps in my side, I can reproduce the issue. After
some further investigation, I found if I unchecked the box "Preserve
formatting during updates", the issue did not appear. So it is controlled
by the option "Preserve formatting during updates".

Could you please give it a test in your side that if you uncheck this
option, do you see the new added value in correct format(Arial Bold 12)


Best regards,
Ji Zhou - MSFT
Microsoft Online Community Support
 
P

Peter Karlström

Hi Ji

Thanks for your reply.

I have tested your suggestion and found that it works fine.

Strange though that the property parameter \*MERGEFORMAT actually
messes things up and NOT merging formats.
This is another approach to the parameter than it was in Word 2003 and before.

Anyways, thanks a lot for your help.

This will definitely fix our problem.

--
Best Regards
Peter Karlström
Midrange AB, Sweden


Ji Zhou said:
Sorry for not mentioning that the option "Preserve formatting during
updates" appears in the dialog when we add the field.
 

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