Insert Text From File causes loss of text styles

This problem has been occuring for me for years, and going back multiple versions of Word  2003, 2007 and 2010.   It occurs both programatically using Word's VBA to open a .DOC file and insert the contents of another .DOC file.  And also just opening a .DOC file and using Word's Insert -> Text From File.

It does not happen with every document and so far can't pin it down to any thing specific.  Also, it happens with paragraphs and text that are set to regular fonts (i.e. not using Word Styles) and also when creating custom Word Styles and setting the paragraphs to those styles in the doucment that is to be inserted at the end of an existing document. 

All the fonts do exist and all docs were created the same way on the same computer.  Nothing fancy just plain text.

What happens is when the 2nd document is inserted at the end of the open document.  Sometimes entire paragraphs change to a different font, font color and/or font size.   In tests where I set custom Word Styles.   And the same custom Word Style existed in both documents with the same settings - the paragraphs don't have the style setting anymore in the inserted text.

Most of the time it works, but many times it doesn't.   And when it doesn't work, its usually only portions of the document that loose the formatting.

Any idea why this happens and how to prevent it?

January 19th, 2012 9:35pm

Thank you for your replies,

I have now tried the approach in the mentioned link, but unfortunately the result is the same. Although my documents hasn't a numbered list but a bulleted list I used the approach mentioned.

Again: I have different tab settings in the source and target documents, and I want the target documents style tab settings to apply when I insert a source document with the same style name. But it doesn't.

What can be the problem?

Best regards,
Peeter

Free Windows Admin Tool Kit Click here and download it now
July 24th, 2015 8:50am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics