Traslate Office Interop function calls to C++ from VB
Posted on 2011-03-18
Code for (c++) samples for Microsoft Office Interop use are rare and hard to find. Mostly I translate them from VB to C++ I have having a real problem compiling with one of them.
. A vb command that works in other apps that I wrote is
Dim formatDOC As Object = Word.WdSaveFormat.wdFormatDocument
I have translated it to
Microsoft::Office::Interop::Word::WdSaveFormat* formatRTF = new Microsoft::Office::Interop::Word::WdSaveFormat::wdFormatDocument ;
or simply (both should work)
Word::WdSaveFormat* formatR = new Word::WdSaveFormat::wdFormatDocument;
These line bring the error message -
error C2061: syntax error : identifier 'wdFormatDocument'
I have checked spelling a dozen times.
I have been unable to find any reports of this being turned in as a bug.
Thanks for any insight into this issue.