mukul nagpal
mukul nagpal

Reputation: 103

How to split word file with formatting retained

I am trying to split a word file, I have seen numerous links for it , but formatting is not getting preserved. only the string inside the file is there in the new splitted files, but I want to have all the images , bullets , etc. to be there in the new splitted files. I tried it using C# but , interop assembly has a limitation that it can't reserve formatting. Also thinking of converting into zip and then extract from the xml files?

The things I tried are:
http://www.extendoffice.com/documents/word/966-word-split-document-into-multiple-documents.html https://msdn.microsoft.com/en-us/library/ee872374(v=office.12).aspx

Upvotes: 0

Views: 2291

Answers (1)

Rahul
Rahul

Reputation: 11560

If everything else is worked out, you can use Range.FormattedText from range objecr for both source and target documents to preserve formatting.

see https://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.range.formattedtext.aspx

It also lists code for C#

Range FormattedText { get; set; }

Upvotes: 0

Related Questions