HTML to WordML -- and vice versa

How do I create a standalone application that opens an HTML file as a Word document? Also, how do I later save this Word document into HTML? I want to be able use Word's functionality, if possible. I tried adding a Word reference to my project, but could not declare such an object:

' squiggly line under "Word"
Dim objWord as Word

I figured I might be able to use Word's methods and properties to do this.
xmlnewbieAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

anvCommented:


here's the code to convert a word document to html

void DocToHtml(string docPath,string htmlPath)
{
Word.Application app=new Word.Application();
app.Visible=false;
Object o=Missing.Value;
object docFile=docPath;
_Document doc=app.Documents.Open(ref docFile,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref
o);
object fileName=htmlPath;
object format=8;//Html
doc.SaveAs(ref fileName,ref format,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o);
object t=true;
app.Quit(ref t,ref o,ref o);
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
xmlnewbieAuthor Commented:
What does that mean??
0
anvCommented:
also u can check the link below:

for further details

http://www.devhood.com/messages/message_view-2.aspx?thread_id=36523

its for the same as above.
0
ClearlyCommented:
OK so this converts from Word to HTML. How do you convert from HTML to WordML? I'ma ssuming the only change is the format # but I don't know what that is.

Also, is there a way to do this without loading the WINWORD.EXE COM object?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.