在Outlook 2013中通过VBScript访问公用文件夹中的电子邮件 [英] Access email in public folder by VBScript in Outlook 2013
问题描述
如何使用VBScript或其他方式访问公用文件夹中的电子邮件?
我想过滤公共文件夹中的一些电子邮件(过滤发送的日期时间),然后向客户发送通知邮件。
任何人都可以提供帮助吗?
谢谢!
您好,
您可以使用
GetDefaultFolder 命名空间类的方法,其中r eturns a 文件夹 对象
表示当前个人资料所请求类型的默认文件夹。您只需要传递
olPublicFoldersAllPublicFolders 值。例如:'GetFolder - 获取基于字符串路径的Public文件夹 - 例如
'如果英文文件夹名称为
'公共文件夹\所有公共文件夹\欧洲工作流程
'刚刚传入"Europeen Workflow"
公开函数GetPublicFolder(strFolderPath)
Dim colFolders
Dim objFolder
Dim arrFolders
Dim i
On Error Resume Next
strFolderPath = Replace(strFolderPath ," /"," \")
arrFolders = Split(strFolderPath," \")
设置objFolder = Application.Session.GetDefaultFolder(18)
设置objFolder = objFolder.Folders.Item(arrFolders(0))
如果不是objFolder则没有那么
For i = 1 To UBound(arrFolders)
设置colFolders = objFolder。文件夹
设置objFolder = Nothing
设置objFolder = colFolders.Item(arrFolders(i))
如果objFolder是Nothing那么
退出
结束如果
下一个
结束如果
设置GetPublicFolder = objFolder
设置colFolders = Nothing
设置objApp = Nothing
设置objFolder = Nothing
结束函数有关更多信息,请查看以下页面:
如何获取公用文件夹的引用使用Outlook 2010的Outlook对象模型进行存储?
How to use VBScript or other way to access email in public folder?
I would like to filter some emails in public folder (filter the sent date time) and then send notification email to client.
Anyone can help?
Thank you!
Hello,
You can use the GetDefaultFolder method of the Namespace class which returns a Folder object that represents the default folder of the requested type for the current profile. You just need to pass the olPublicFoldersAllPublicFolders value. For example:
' GetFolder - Gets a Public folder based on a string path - e.g. 'If Folder name in English is 'Public Folders\All Public Folders\Europeen Workflow 'The just pass in "Europeen Workflow' Public Function GetPublicFolder(strFolderPath) Dim colFolders Dim objFolder Dim arrFolders Dim i On Error Resume Next strFolderPath = Replace(strFolderPath, "/", "\") arrFolders = Split(strFolderPath, "\") Set objFolder = Application.Session.GetDefaultFolder(18) Set objFolder = objFolder.Folders.Item(arrFolders(0)) If Not objFolder Is Nothing Then For i = 1 To UBound(arrFolders) Set colFolders = objFolder.Folders Set objFolder = Nothing Set objFolder = colFolders.Item(arrFolders(i)) If objFolder Is Nothing Then Exit For End If Next End If Set GetPublicFolder = objFolder Set colFolders = Nothing Set objApp = Nothing Set objFolder = Nothing End FunctionTake a look at the following pages for more information:
How to get reference to Public Folder Store using Outlook Object Model for Outlook 2010?
这篇关于在Outlook 2013中通过VBScript访问公用文件夹中的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!