If you want to programmatically insert a signature, Redemption (I am its author) exposes RDOSignature object which implements ApplyTo method (it handles the signature image files and merges HTML styles appropriately).Īlso keep in mind that Outlook inserts a signature automatically when a message is displayed as long as the message body is not modified prior to the call. It is your responsibility to retrieve images from the signature, add image files as attachments, set PR_ATTACH_CONTENT_ID MAPI property, and modify the image source in the img tag to reference the image by the cid rather than path. When you create HTML body, the file path is left as is. The two must be merged.īy default, img tags in HTML signatures reference image files using a relative (to the Signatures folder) path. Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)įirstly, do not concatenate HTML strings - concatenating two well-formed HTML documents won't produce a valid HTML document. Set fso = CreateObject("Scripting.FileSystemObject") If bStarted Then 'If the macro started Outlook, stop it again.įunction GetBoiler(ByVal sFile As String) As String HTMLBody = frmPrevious.EmailContent & vbNewLine & vbNewLine & Signature CC = " Request for Credit Check" + " " + Format(Date, "mmm yyyy") 'This is the message subject Set oItem = oOutlookApp.CreateItem(olMailItem) ' Change only Mysig.htm to the name of your signature Set oOutlookApp = CreateObject("Outlook.Application") Set oOutlookApp = GetObject(, "Outlook.Application") 'see if Outlook is running and if so turn your attention there How can I make the sending email show the image? The signature file is located in %appdata%Microsoft/Signature folder. However, the image in the signature cannot be shown. I am trying to send Outlook email from MS Access VBA.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |