Com InvokeHelper 问题
我在互联网上找到了以下代码片段,它从模板创建了一封电子邮件:
LPDISPATCH _Application::CreateItemFromTemplate(LPCTSTR TemplatePath, const VARIANT& InFolder)
{
LPDISPATCH result;
static BYTE parms[] =
VTS_BSTR VTS_VARIANT;
InvokeHelper(0x10b, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms,
TemplatePath, &InFolder);
return result;
}
这段代码的问题是它需要最后一个参数来拥有一个文件夹。使用我的代码没有文件夹,发送后的电子邮件将上传到另一个应用程序中。我尝试将 NULL
作为最后一个参数传递,但这只会引发异常。
我想要实现的目标是使用模板打开电子邮件,并且该模板在用户的 Outlook 桌面上可见。因此,我的问题是我应该将什么作为参数传递给这个 InvokeHelper 方法?是只是最后一个参数,还是最后一个参数是NULL
,但是其他的都变了,如果是的话又变成了什么?
谢谢
I have found the following snippet of code on the internet, which creates an email from a template:
LPDISPATCH _Application::CreateItemFromTemplate(LPCTSTR TemplatePath, const VARIANT& InFolder)
{
LPDISPATCH result;
static BYTE parms[] =
VTS_BSTR VTS_VARIANT;
InvokeHelper(0x10b, DISPATCH_METHOD, VT_DISPATCH, (void*)&result, parms,
TemplatePath, &InFolder);
return result;
}
The problem that I have with this code is that it requires the last parameter to have a folder. With my code there is no folder, the email after it sent will be uploaded into another application. I have tried passing NULL
as the last parameter, but this just throws an exception.
All I am trying to achieve is to open an email using a template with it visible on the user's Outlook Desktop. Therefore, my question is what should I pass as the parameters to this InvokeHelper
method? Is it just the last parameter, or the last parameter be NULL
, but the others changed, if so to what?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个代码:
其中:
strSubject = ""
strAttachments = ""
strRecipients = "[email protected ]"
strBody = ""
在你让它工作之后,你可以使用参数......
try this code:
where:
strSubject = ""
strAttachments = ""
strRecipients = "[email protected]"
strBody = ""
after you get this to work, you can play with the parameters...