object.Open PathName[, OpenAs ][, ReadOnly]ParametersobjectAn expression that evaluates to a Documents object.PathNameA String that specifies the full path to the document.OpenAs(Optional) A Variant that is a String specifying the document type when the document opens. Possible values are: "Text" Opens the document as a text file.
"Auto" Opens the document in the default editor (the default).
ReadOnly(Optional) A Variant that is a Boolean specifying whether the document is read-only. Possible values are: True Opens as read-only.
False Opens as read/write (the default).
ExampleThe following example opens the macro file C:\ Program Files\Microsoft Visual Studio\Common\MSDEV98\Macros\Sample.dsm as read-only:
"Auto" Opens the document in the default editor (the default).
ReadOnly(Optional) A Variant that is a Boolean specifying whether the document is read-only. Possible values are: True Opens as read-only.
False Opens as read/write (the default).
ExampleThe following example opens the macro file C:\ Program Files\Microsoft Visual Studio\Common\MSDEV98\Macros\Sample.dsm as read-only:
解决方案 »
- 紧急求助,串口通信程序崩溃
- VC TAB标签在鼠标移动过时改变颜色 如何实现
- 再问一个真正超高难的问题:有没有办法拦截指定进程的I/O操作?(呜,没分了,有分了再往上加)
- 请问CComboBox如何设置当选取一个值A1时取得对应的B1值.
- 一个MFC小基础问题,一个语法问题,谢谢!
- 失业了,散分!!!
- 请问,如何给对话框加工具栏和状态栏?
- 求助……都说标题要长才能引起哥哥姐姐注意…… 求,跪求……想学木马。求大侠给个简单的木马源程序……学习下
- 跪求高手在线指导一下!有没有做过GPS接收(串口通讯)方面的老师啊?ToT
- 谁会编与CPU无关的标准延时程序???国内无人会???
- 急!100分求教!
- 在哪儿可以download windows 的latest Platform SDK header/library
but what I want is that format , i want is this format below
//////////////////////LPDISPATCH Documents::Open(VARIANT* FileName, VARIANT*onfirmConversions, VARIANT* ReadOnly, VARIANT* AddToRecentFiles,
VARIANT* PasswordDocument, VARIANT* PasswordTemplate,
VARIANT* Revert, VARIANT* WritePasswordDocument,
VARIANT* WritePasswordTemplate, VARIANT* Format,
VARIANT* Encoding, VARIANT* Visible)///////////////////////////
shall you introduce this format for me
if you shall ,i am ever so much
you are a good man
COleVariant vOpt(DISP_E_PARAMNOTFOUND, VT_ERROR) not varNull as you used.
also u can use: VARIANT varOpt;
varOpt.vt = VT_ERROR;
varOpt.scode = DISP_E_PARAMNOTFOUND;
只要一个参数的Open函数。
加入你自己的程序就可以了
程序如下:
在Documents中加入:LPDISPATCH Documents::Open(VARIANT* FileName)
{
LPDISPATCH result;
static BYTE parms[] = VTS_PVARIANT;
InvokeHelper(0xc, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms, FileName);
return result;
} 在程序中调用即可: m_docTest= m_docs.Open(COleVariant("f:\\test.doc"));
you give me much help ,now let me say thank you all again
but there are two question
first: VARIANT* Format ---how use it and its meaning?
second: VARIANT* Visible ---how use it and its meaning?oh ,there is a error in that statement below
myDoc.Close( &varTrue, &varDocName, &varNull);
error:类型不匹配
please change the error for me ,thanks