2012-09-11 106 views

回答

1

您可以获取此信息,每次一个电子邮件与此。

http://vboffice.net/sample.html?lang=en&mnu=2&smp=65&cmd=showitem

Public Sub GetItemsFolderPath() 
    Dim obj As Object 
    Dim F As Outlook.MAPIFolder 
    Dim Msg$ 
    Set obj = Application.ActiveWindow 
    If TypeOf obj Is Outlook.Inspector Then 
    Set obj = obj.CurrentItem 
    Else 
    Set obj = obj.Selection(1) 
    End If 
    Set F = obj.Parent 
    Msg = "The path is: " & F.FolderPath & vbCrLf 
    Msg = Msg & "Switch to the folder?" 
    If MsgBox(Msg, vbYesNo) = vbYes Then 
    Set Application.ActiveExplorer.CurrentFolder = F 
    End If 
End Sub