try
{
Microsoft.Office.Interop.Word.Application WordObj = System.Runtime.InteropServices.Marshal.GetActiveObject("Word.Application") as Microsoft.Office.Interop.Word.Application;
Office.CustomXMLParts currClassification = WordObj.ActiveDocument.CustomXMLParts;
}
catch(Exception ex)
{
//I am getting, This command is not available because no document is open. this error here.
}
当我使用上面的代码时,我收到此错误:
此命令不可用,因为没有文档打开。
此致