Vb6 Visual Basic 6:读取MSG文件并提取内容

Vb6 Visual Basic 6:读取MSG文件并提取内容,vb6,outlook,Vb6,Outlook,我想阅读文件系统中存储的MSG文件,并执行以下操作: 读取msg文件的正文文本。 在MSG文件中打开并保存附件。 是否可以使用Microsoft Outlook 10.0对象库msoutl.olb 我希望避免使用基于 有问题 谢谢。我相信你可以。尝试添加对Outlook 10对象库的引用,然后尝试以下代码: Dim OL As Outlook.Application Dim Msg As Outlook.MailItem Set OL = New Outlook.Application Se

我想阅读文件系统中存储的
MSG
文件,并执行以下操作:

  • 读取msg文件的正文文本。
  • MSG
    文件中打开并保存附件。
是否可以使用Microsoft Outlook 10.0对象库msoutl.olb

我希望避免使用基于 有问题


谢谢。

我相信你可以。尝试添加对Outlook 10对象库的引用,然后尝试以下代码:

Dim OL As Outlook.Application
Dim Msg As Outlook.MailItem
Set OL = New Outlook.Application
Set Msg = OL.CreateItemFromTemplate("c:\msg.msg")
' now use msg to get at the email parts
MsgBox Msg.Subject
Set OL = Nothing
Set Msg = Nothing
我不能担保Outlook.MailItem对象(msg)的任何方法或属性,但请试一试