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 Stefan,

sorry for not explaining more precisely. Firstly it is a mistake that the spacing in the source document isn't according to the style. But isn't it strange that if you examine the settings via Shift+F1, it doesn't inform you of any direct formatting?!

   

Sorry, there was an error in my previous response (now corrected). The direct formatting added is Line Spacing 1.5 (while the rest of the text is set to "Single"). If you select the option (in the Styles pane) to show the source of formatting, you'll see that if you click in the affected paragraph.

Numbering must be set up via Home tab | Multilevel List. See http://shaunakelly.com/word/numbering/numbering20072010.html.

Free Windows Admin Tool Kit Click here and download it now
July 6th, 2015 1:56pm

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

Other recent topics Other recent topics