我需要一个用于MS Outlook 2013和365的宏 [英] I need a macro for MS Outlook 2013 and 365

查看:35
本文介绍了我需要一个用于MS Outlook 2013和365的宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将收件箱中的邮件保存到对话中显示的另一条邮件的同一文件夹中



如果我使用按日期过滤收件箱并使用转换视图



同一会话下的旧邮件已保存在某个文件夹中,我们可以将其称为FFFF


我可以在收件箱中看到旧邮件下的文件夹名称




现在我需要移动新消息到达同一文件夹,但我需要避免


1-从收件箱窗格拖放到文件夹窗格(我需要滚动并将鼠标悬停在所有文件夹上)


2-使用右键单击消息,然后选择表单,移动到其他文件夹,然后我从文件夹窗口开始唠叨



我更喜欢选择新消息(没有更冷)和旧消息(alre) ady in a folder)



然后点击类似


< p style ="">(保存在同一个文件夹中)或


(合并到文件夹中)


(移动到同一文件夹)



在所有命令或规则或任何其他方式下都不存在



我猜宏是唯一的方式 


你能给我这个宏吗?


我可以粘贴它并申请







其他描述我的问题



我总是在(对话模式)使用收件箱


所以新邮件在收件箱内,旧邮件在其他文件夹中


我需要首先阅读新消息,此处的规则无法正常工作,因为发件人可能会更改,或者主题可能是cha nged



在我阅读新邮件后,我还可以看到旧电子邮件中的相同的视图(使用文件夹名称,保存其他电子邮件的地方)我需要有一些方法将新电子邮件拖放到文件夹中,而不使用
移动的唯一方式到其他文件夹并在长文件夹列表中搜索,或者先在
文件夹窗格中搜索该文件夹,然后拖放到那里(两种方式都需要时间) )



可能的解决方案



  1. 使用搜索窗口搜索文件夹


  2. < li style ="">

    要显示文件夹名称并可用于拖放



  3. (收件箱中)某些电子邮件的一组命令(在同一文件夹中移动),至少有一个文件夹



我在快照上附上一些解释






解决方案

您好,


VBA宏不能用于自定义Outlook UI。如果要添加上下文菜单项,则需要开发COM加载项将电子邮件移动到另一个文件夹。在以下系列文章中阅读有关Ribbon UI(又名Fluent UI)的更多信息:


为开发人员自定义2007 Office Fluent功能区(第1部分,共3部分)


自定义2007 Office Fluent
开发人员功能区(第2部分,共3部分)


自定义
2007 Office Fluent Ribbon for Developers(第3部分,共3部分)



请参阅演练:为Outlook创建您的第一个VSTO加载项 到
快速入门。


此外,您可以将传入的项目自动移动到现有文件夹与其他会话项目。为了实现你需要处理Application类的NewMailEx事件。    NewMailEx   event
在新邮件到达收件箱时以及客户端规则处理发生之前触发。您可以使用 
EntryIDCollection  数组
来调用 
NameSpace .GetItemFromID  方法
并处理该项目。 
Theevent会为每个收到的项目触发一次由Microsoft Outlook处理。该项目可以是几种不同项目类型的一个
,例如 
MailItem ,  MeetingItem
或 
SharingItem
 
EntryIDsCollection   string
包含与该项目对应的条目ID。


要在对话中查找相关项目,您可以使用  高级搜索 &bbsp  
应用程序类。阅读更多关于  以编程方式在Outlook中进行高级搜索:C#,VB.NET  文章。 



最后,
Move
方法MailItem类的m 将Microsoft Outlook项目移植到新文件夹。例如:

 Sub MoveItems()
Dim myNameSpace As Outlook.NameSpace
Dim myInbox As Outlook.Folder
Dim myDestFolder As Outlook.Folder
Dim myItems As Outlook.Items
Dim myItem As Object

Set myNameSpace = Appl ication.GetNamespace(" MAPI")
设置myInbox = myNameSpace.GetDefaultFolder(olFolderInbox)
设置myItems = myInbox.Items
设置myDestFolder = myInbox.Folders(" Personal Mail")
设置myItem = myItems.Find(" [SenderName] ='Eugene Astafiev'")
TypeName(myItem)<> "没什么"
myItem.Move myDestFolder
设置myItem = myItems.FindNext
Wend
End Sub


How to save message in the inbox into the same folder of another message shown on conversation

If I am using filter the inbox by date and using conversion view

the old messages under same conversation are already saved in a certain folder lets call it FFFF

and i can see on the inbox the folder name under the older messages

now i need to move the new message arrived into the same folder but i need to avoid

1- drag and drop from inbox pane to folder pane (i need to scroll and hover over all folders)

2- using the right click on message , then form the menu is select, move to other folder, then i start crolling from folder window

I prefer to select the new message (with out colder) and the older message (already in a folder)

and then click in something like

(Save in same folder) or

(merge in folder)

(move to same folder)

which does not exist under all commands or rules or any other way

I guess a Macro is the only way 

can you provide me with this macro

i can paste it and apply

Other descriptino to my problem

I always use the inbox in (conversation mode)

so new messages are inside the inbox , and old messages are in the other folders

I need to read the new message first, , rules here cannot work, since sender might change, or subject can be changed

after I read the new email, I will be able to see also the old email in the same view (with the folder name, where the other emails are saved) I need to have some way to drag and drop the new email into the folder without using the only way wich is move to other folder and search inside long list of folders, or to search the folder first in the folder pane, and drag and drop there (both ways takes time)

Possible solutions

  1. To have search window to search a folder

  2. To have something to show the folder name and can be used to drag and drop

  3. A command to (move in same folder) for group of emails some in (inbox) and at least one has got a folder

I am attaching some explanation on a snap


解决方案

Hello,

VBA macros can't be used for customizing the Outlook UI. You need to develop a COM add-in if you want to add context menu items for moving emails to another folder. Read more about the Ribbon UI (aka Fluent UI) in the following series of articles:

Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)

Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)

Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

See Walkthrough: Creating Your First VSTO Add-In for Outlook to get started quickly.

Also you can move incoming items to the existing folder with other conversation items automatically. For implementing that you need to handle the NewMailEx event of the Application class. The NewMailEx event fires when a new message arrives in the Inbox and before client rule processing occurs. You can use the Entry ID returned in the EntryIDCollection array to call the NameSpace.GetItemFromID method and process the item. Theevent fires once for every received item that is processed by Microsoft Outlook. The item can be one of several different item types, for example, MailItemMeetingItem, or SharingItem. The EntryIDsCollection string contains the Entry ID that corresponds to that item.

To find a related item in the conversation you can use the AdvancedSearch method of the Application class. Read more about the method in the Advanced search in Outlook programmatically: C#, VB.NET article. 

Finally, the Move method of the MailItem class which moves a Microsoft Outlook item to a new folder. For example:

Sub MoveItems() 
 Dim myNameSpace As Outlook.NameSpace 
 Dim myInbox As Outlook.Folder 
 Dim myDestFolder As Outlook.Folder 
 Dim myItems As Outlook.Items 
 Dim myItem As Object 
 
 Set myNameSpace = Application.GetNamespace("MAPI") 
 Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox) 
 Set myItems = myInbox.Items 
 Set myDestFolder = myInbox.Folders("Personal Mail") 
 Set myItem = myItems.Find("[SenderName] = 'Eugene Astafiev'") 
 While TypeName(myItem) <> "Nothing" 
 myItem.Move myDestFolder 
 Set myItem = myItems.FindNext 
 Wend 
End Sub


这篇关于我需要一个用于MS Outlook 2013和365的宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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