Outlook CopyTo错误 [英] Outlook CopyTo Error

查看:104
本文介绍了Outlook CopyTo错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 设置oStores = Application.GetNamespace(" MAPI")。商店



 设置oStore = oStores(" ismael.magma @ outlook.es")



 设置oFolder = oStore.GetRootFolder





 设置myCal = Application.GetNamespace(" MAPI")。GetDefaultFolder(FolderType:= olFolderCalendar)

 设置oExplorer = myCal.GetExplorer



 设置oItems = myCal.Items



$
 对于每个oItemOriginal In oItems

      MsgBox oItemOriginal.ConversationTopic

 下一步


  For i = 1 To oItems.Count

     设置oItemOriginal = oItems(i)

  &NBSP;   oItemOriginal.CopyTo(oFolder,copyoptions:= olCopyAsAccept)  &NBSP; &NBSP; &NBSP;  < - 错误预期:=

 结束



我做错了什么?



         &NBSP; &NBSP;&NBSP; &NBSP;   

解决方案

大卫你好,


你得到什么错误?你尝试调试代码了吗?你可以更具体一点吗?


只有AppointmentItem类提供
CopyTo
方法。您需要确保根据约会项目调用它。我建议在调用方法之前检查消息类。它是预约项吗?


CopyTo   如果目标文件夹不是合适的文件夹,则会返回错误键入  AppointmentItem   对象,或者如果用户没有必要的
权限来创建项目指定的目标文件夹。


设置REG_MULTI_SZ值,  DisableCrossAccountCopy ,在  HKCU \ Software \ Microoft \在
中的Office \15.0 \Outlook
  Windows注册表具有禁用此方法的副作用。


最后,请注意,该方法是在Outlook 2010中引入的。您安装了哪些Outlook版本?




 Set oStores = Application.GetNamespace("MAPI").Stores

 Set oStore = oStores("ismael.magma@outlook.es")

 Set oFolder = oStore.GetRootFolder


 Set myCal = Application.GetNamespace("MAPI").GetDefaultFolder(FolderType:=olFolderCalendar)
 Set oExplorer = myCal.GetExplorer

 Set oItems = myCal.Items


 For Each oItemOriginal In oItems
     MsgBox oItemOriginal.ConversationTopic
 Next

 For i = 1 To oItems.Count
     Set oItemOriginal = oItems(i)
     oItemOriginal.CopyTo(oFolder, copyoptions:=olCopyAsAccept)          <-- Error Expected :=
 End

What am I doing wrong?

                  

解决方案

Hello David,

What error do you get? Did you try to debug the code? Could you please be more specific?

Only the AppointmentItem class provides the CopyTo method. You need to be sure that you call it against an appointment item. I'd suggest checking the message class before calling the method. Is it an appointment item?

CopyTo returns an error if the destination folder is not an appropriate folder type for an AppointmentItem object, or if the user does not have the necessary permissions to create items in the specified destination folder.

Setting the REG_MULTI_SZ value, DisableCrossAccountCopy, in HKCU\Software\Microsoft\Office\15.0\Outlook in the Windows registry has the side effect of disabling this method.

Finally, be aware, the method was introduced with Outlook 2010. What Outlook version do you have installed?


这篇关于Outlook CopyTo错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆