问题描述
亲爱的朋友们,
我试图在Microsoft MFC SDI SDK应用程序中嵌入microsoft字。我可以使用以下MSDN帮助程序执行此操作:
如何使用MFC嵌入和自动化Word文档
但是当试图保存时该文件,它正在抛出一条错误信息。以下是保存文档的代码。
LPDISPATCH lpDisp ;
lpDisp = m_pItem - > GetIDispatch ();
_文件 doc ;
doc 。 AttachDispatch ( lpDisp );
doc 。 保存 ();
这里我试图使用以下函数保存已打开的文档:
CString strPath = " D:\\Test.doc" ;
m_pItem - > CreateFromFile ( strPath , m_clsid );
以下是调用函数doc.Save()时的错误消息:
请帮助我解决此问题。
谢谢和问候,
Alvin
Dear friends,
I am trying to embed microsoft word inside an MFC SDI SDK application. And I could able to do this using the following MSDN help program:
How to embed and automate a Word document with MFC
But when trying to save the document, it is throwing an error message. Below is the code for saving the document.
LPDISPATCH lpDisp;
lpDisp = m_pItem->GetIDispatch();
_Document doc;
doc.AttachDispatch(lpDisp);
doc.Save();
Here I am trying to save the document which is already opened using the below function:
CString strPath = "D:\\Test.doc";
m_pItem->CreateFromFile(strPath, m_clsid);
Following is the error message when calling the function doc.Save():
Please some one help me to fix this issue.
Thanks and Regards,
Alvin
这篇关于Microsoft Word自动化 - 在VC ++中嵌入Word MFC SDI - 保存文档时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!