SaveAs vs SaveAs2 in the Microsoft Office Word obj

2019-01-25 06:02发布

问题:

It looks like SaveAs has gone away in Office 2010 in favor of SaveAs2. What is going on here? Are there any important differences between the two? My fix has been to check for SaveAs2 first, and then fall back to SaveAs. Is this reasonable?

回答1:

It hasn't gone away, you've just got another way to save the document. Save2() takes an extra argument, CompatibilityMode. If you don't care about the compatibility mode then just keep using Save(). If you do then check Application.Version to verify that you can call Save2() without getting an exception.