SaveAs2 For Word 2010 not working with Client PC having Word 2007

一曲冷凌霜 提交于 2019-12-01 06:07:11
Steve

From MSDN

SaveAs2
This method appears in IntelliSense in Word 2007 projects that target the .NET Framework 4. However, this property cannot be used in Word 2007 projects

By the way, if you search on this site you find the response at your problem here

You could check the version of the current Word installed on the user PC using this code:

string v = _myWordApp.Version;
switch(v)
{
    case "7.0":
    case "8.0":
    case "9.0":
    case "10.0":
    _myWordDoc.SaveAs2000(ref _documentFile, ref _nothing, ref _nothing, ref _nothing, 
        ref _nothing, ref _nothing, ref _nothing, ref _nothing, 
        ref _nothing, ref _nothing, ref _nothing);
      break; 
    case "11.0":
    case "12.0"
    _myWordDoc.SaveAs(ref _documentFile, ref _nothing, ref _nothing, ref _nothing, 
        ref _nothing, ref _nothing, ref _nothing, ref _nothing, 
        ref _nothing, ref _nothing, ref _nothing, ref _nothing,
        ref _nothing, ref _nothing, ref _nothing, ref _nothing);
    case "14.0"
    _myWordDoc.SaveAs2(ref _documentFile, ref WdSaveFormat.wdFormatHTML, 
                ref _nothing, ref _nothing, ref _nothing, 
        ref _nothing, ref _nothing, ref _nothing, ref _nothing, 
        ref _nothing, ref _nothing, ref _nothing, ref _nothing,
        ref _nothing, ref _nothing, ref _nothing, 
                ref Microsoft.Office.Interop.Word.WdCompatibilityMode.wdWord2007);
      break;
    default:
      errorText = "Not able to get Word Version"
      break;
} 

Sorry for the C# code, but it's easy to translate.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!