2014-01-08 83 views
1

我已經Outlook郵件條目ID,我想要那個條目號這就是細節,主題,正文等..郵件細節

電子郵件仍然在收件箱中沒有任何地方移動

我寫的代碼在VBA提前

謝謝..

Private Sub CommandButton4_Click() 
i = 0 
j = 1 

昏暗的路徑,FileNa我作爲字符串 設置currentExplorer = Application.ActiveExplorer 集選擇= currentExplorer.Selection

 Set currentMail = objNameSpace.GetItemFromID("000000000AB85207D8C3664BA439B3CE1603D186070019BED8705003484BACA686B84F9C6E880000006DE67E000019BED8705003484BACA686B84F9C6E880000428CEF9B0000") 
       MailTo = currentMail.To 
       MailSubject = currentMail.Subject 
       MailBody = currentMail.Body 
       MailDateTime = currentMail.CreationTime 
       attcount = currentItem.Attachments.Count 

     For j = 1 To attcount + 1 


      'FileName = "\\wipfs01\ES Quality\Personal Folders\Mahesh\Tools\Sorting-Telus\Attachment\" & Atmt.FileName 
      'Atmt.SaveAsFile FileName 

      Set chk = UserForm2.Controls("chkn" & j) 

      If chk.Value = True Then 

       path = SaveAttachment("\\wipfs01\ES Quality\Personal Folders\Mahesh\Tools\Sorting-Telus\Attachment\PO\") 
       FileName = path & currentItem.Attachments(j).FileName 
       currentItem.Attachments(j).SaveAsFile FileName 

       Set currentMail = currentItem 
       MailTo = currentMail.To 
       MailSubject = currentMail.Subject 
       MailBody = currentMail.Body 
       MailDateTime = currentMail.CreationTime 
       chk.Visible = False 
      End If 


     Next j 

    'MsgBox MailTo & vbCrLf & MailSubject & vbCrLf & MailBody & vbCrLf & MailDateTime 

末次

+0

你應該發佈一些代碼。你試圖解決這個問題。 – MikroDel

+0

Ohter way that question may be closed or not answers – MikroDel

+0

@MikroDel我已添加代碼 – Mahesh219

回答

0

使用Namespace.GetItemFromID使用其條目標識打開郵件。

+0

謝謝它對我有用 – Mahesh219