excel - Upload attachment to Outlook as relative path -
I have a code that creates a PDF of a sheet and saves it in a relative path, then I will send an email to that PDF I'm trying to upload which displays (does not send). I want all this to happen at once, I click on a button (Macro has given this macro a macro to run on this button).
However, I'm having trouble working with the attachment, Is it possible to save attachment as a relative path? I call it the I am doing because the code needs to be standardized, so I can use only a spreadsheet by copying it and pasting.
Use specific email address I'm down I
resume error resume with Autmel to 'do Todos Dedos email .to = "" .cc = "" .BCC = "" Subject = "" & amp; Company name & amp; "- Invoice -" & amp; Data & amp; amp; "". Body = "dear," & amp; Chr (10) & amp; Chr (10) & amp; "Please, attach invoices to our company (COLOQUE ACORDO AQUI)." . Attachment Add 'Enclosure Attachment'. Attachment Add ("C: \ test.txt"). Display '.' Display email end with
The way Microsoft is recommended to have it
dim myItem as Outlook. MyAtachments by default in Outlook. Do attachments set myItem = Application.CreateItem (olMailItem) Set myAttachments = myItem.Attachments myAttachments.Add "C: \ Test.doc", _ OlByValue, 1, "Test" myItem.Display < p> here:
Comments
Post a Comment