Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I use this code to print sheets to pdf files but how do I code a VBA macro to
attach the files to an email s = Application.ActivePrinter For i = 1 To 9 Err.Clear On Error Resume Next Application.ActivePrinter = "Adobe PDF på Ne0" & i & ":" If Err.Number = 0 Then Exit For On Error GoTo 0 Next On Error GoTo 0 Worksheets("Kund data").PrintOut Copies:=1, ActivePrinter:= _ "Adobe PDF på Ne0" & i & ":", Collate:=True Worksheets("Schakt dörr").PrintOut Copies:=1, ActivePrinter:= _ "Adobe PDF på Ne0" & i & ":", Collate:=True Worksheets("Korg dörr").PrintOut Copies:=1, ActivePrinter:= _ "Adobe PDF på Ne0" & i & ":", Collate:=True Application.ActivePrinter = s I have tried this script but you have to define the name of the pdf. Is there anyway to get the macro to know what file names and filepaths the new pdfs I just created have? Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem Dim strbody As String Dim cell As Range Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(olMailItem) With OutMail ..To = "" ..CC = "" ..BCC = "" ..Subject = "" ..Attachments.Add ("C:\wittur\offert.pdf") ..Body = strbody ..Display End With Set OutMail = Nothing Set OutApp = Nothing |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to attach doc.to an email? | New Users to Excel | |||
attach outlook email | Excel Discussion (Misc queries) | |||
how do I attach spreadsheet in email | Excel Worksheet Functions | |||
Printing one Adobe pdf instead of multiple pdfs | Excel Programming | |||
attach to email | Excel Programming |