Click here to Skip to main content
15,904,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I am stuck in a project. I have a formatted doc file. I need to copy the contents, add some more text and save it as <same file name>.html format. I am a beginner, please help me out. Thanks guys.
Posted

Probably the safest way is plugin to Word using the exe (I believe).
What you need to do is:

1. Read in the document object using the plugin.
2. Modify the document by adding/removing text.
3. Using the plugin do a save as... and save as html.

If you want to read it in and handle all the Word formatting yourself you´ll have quite some work figuring out the codes for italic, bold, underline, colors, linebreaks, ... and reformatting those to HTML tags.

I have no ready code for this, but I know it can be done and most things mentioned above will be available via google. Make sure you read up on it first and understand the DOM, then start a small prototype. If that works, this will be a piece if cake.

keywords: C#, Word plugin, Word automation, C# using Word in code, ... etc

hope this helps to get you started.
 
Share this answer
 
But anyone please show how to do this.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900