2016-07-07 17 views
0

Ich habe ein Makro, das eine Antwort auf eine ausgewählte E-Mail mit einer Vorlage öffnet. Der Rest der Bilder im E-Mail-Gerät zeigt jetzt jedoch nur ein rotes Kreuz.Outlook-Antwort-Makro zeigt keine Bilder

Kann jemand sehen, warum das passieren könnte?

Sub TacReply() 
Dim origEmail As MailItem 
Dim replyEmail As MailItem 
Set origEmail = Application.ActiveExplorer.Selection(1) 
Set replyEmail = Application.CreateItemFromTemplate("S:\Share\TWGeneral.oft") 
replyEmail.To = origEmail.SenderEmailAddress 
replyEmail.Subject = origEmail.Subject 
replyEmail.HTMLBody = replyEmail.HTMLBody & origEmail.Reply.HTMLBody 
replyEmail.SentOnBehalfOfName = "[email protected]" 
replyEmail.Display 
End Sub 

Thanks :)

Antwort

0

Nur falls jemand das gleiche Problem hat, war hier die Lösung, die ich verwendet:

Sub Forward_Mail_Outlook_With_Signature_Html_2() 

    Dim MyItem As Object 
    Dim MyFwdItem As MailItem 

    Dim SigString As String 
    Dim Signature As String 

    Set MyItem = ActiveExplorer.Selection(1).reply 

    If MyItem.Class = olMail Then 

     Set MyFwdItem = MyItem.Forward 

     'Change only Mysig.htm to the name of the signature 

     SigString = Environ("appdata") & _ 
       "\Microsoft\Signatures\Your Signature.htm" 

     If Dir(SigString) <> "" Then 
      Signature = GetBoiler(SigString) 
     Else 
      Signature = "" 
     End If 

     With MyFwdItem 
      .To = MyFwdItem.SenderEmailAddress 
      .subject = MyFwdItem.subject 
      .HTMLBody = "<br>" & Signature & .HTMLBody 
      .SentOnBehalfOfName = "[email protected]" 
      .Display 


     End With 
    Else 

     MsgBox "Select a mailitem." 

    End If 

ExitRoutine: 
    Set MyItem = Nothing 
    Set MyFwdItem = Nothing 

End Sub 

Private Function GetBoiler(ByVal sFile As String) As String 

    Dim fso As Object 
    Dim ts As Object 
    Set fso = CreateObject("Scripting.FileSystemObject") 
    Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2) 
    GetBoiler = ts.readall 
    ts.Close 

End Function