Word 2013 _Document.SaveAs() not available in MSWORD.OLB

394 views Asked by At

I imported the _Document class from MSWORD.OLB but there is no SaveAs member function, instead there is SaveAs2(). SaveAs2 simply has 1 more parameter in the end to allow backward compatibility. However, if I deploy my C++ application to other computer with older version of MS Office installed, say Office 2007, which has no SaveAs2() method in _Document interface. That will give me an error. Is there any way to call SaveAs() method using Word 2013? Apparently, you can do so in Word VBA code but I dont know how to do it in C++.

1

There are 1 answers

0
newbie On BEST ANSWER

It turned out that when import the class _Document, VC6 could not generate SaveAs method. So I simply used VS2010 and import MSWORD.OLB from there. I then find the SaveAs method! Just copy it to my VC6 project and everything works like a charm.