我想要访问Outlook 2010中的电子邮件标题。 我使用下面的代码,但不幸的是,结果仅包含标题的前252个字符。任何关于我做错的建议?使用VBA检索到的截断的Outlook电子邮件标题
Dim strHeader As String
strHeader = GetInetHeaders(olItem)
MsgBox "Truncated string: " & strHeader
和
Function GetInetHeaders(olkMsg As Outlook.MailItem) As String
' Purpose: Returns the internet headers of a message.'
' Written: 4/28/2009'
' Author: BlueDevilFan'
' Outlook: 2007'
Const PR_TRANSPORT_MESSAGE_HEADERS = "http://schemas.microsoft.com/mapi/proptag/0x007D001E"
Dim olkPA As Outlook.PropertyAccessor
Set olkPA = olkMsg.PropertyAccessor
GetInetHeaders = olkPA.GetProperty(PR_TRANSPORT_MESSAGE_HEADERS)
Set olkPA = Nothing
End Function
从预期删除的答复中复制“我使用的调试功能将变量变为252个字符。使用@niton中描述的方法显示该功能在Outlook 2010中运行良好”Jofre – niton