HI, Everyone..
I am working on module to convert Doc/Docx to word 2003 XML document using c++..But i had great problem writing native c++ code for conversion process..I had come across interop assemblies which easy the process instead of writing prolonged
code..But interop assemblies have support to .NET and C#..i have seen so many examples which have implemented this task using c#..is there any existing examples in C++ to implement this task??..This is my sample code..please correct it..i am not getting
proper output:
void SaveXml();
{
String fn = @"C:\Users\zbook\Desktop\Track test.docx";
String fn_xml = @"C:\Users\zbook\Desktop\Track test3.xml";
Microsoft::Office::Interop::Word::Application app = new Microsoft::Office::Interop::Word:: Application();
Word::Documents docs = app->Documents;
Word::Document doc = docs->Open(fn, ReadOnly:true);
//bool b = doc.TrackFormatting; // for some reason this line bombs
doc->SaveAs2(fn_xml, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatXML);
doc->Close(false);
Marshal->ReleaseComObject(doc);
// now open up fn_xml ... and do whatever
app->Quit(false);
Marshal->ReleaseComObject(docs);
Marshal->ReleaseComObject(app);
}