Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Sending PDF with Outlook

Hi,

I'm using Ron de Bruin's "Mail_ActiveSheet_PDF_Outlook" macro.
How I must to change the code that macro go to pick addresses from table
data from column J
and stop receiving mail when there is no anymore addresses in column J in
table data?

Greetings,
Kari


Sub Mail_ActiveSheet_PDF_Outlook()
'Note: It is easy to change the code to send a workbook, selection or range.
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim FilenameStr As String
If Dir(Environ("commonprogramfiles") & "\Microsoft Shared\OFFICE" _
& Format(Val(Application.Version), "00") & "\EXP_PDF.DLL") < "" Then
FilenameStr = Application.DefaultFilePath & "\" & _
Format(Now, "dd-mmm-yy") & ".pdf"
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=FilenameStr, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
strbody = "Hello" & vbNewLine & vbNewLine & _
"Here is to you latest attachment" & vbNewLine & _
vbNewLine & "t. Kari"
On Error Resume Next
With OutMail
.To = "here comes data from table data column J"
.CC = ""
.BCC = ""
.Subject = "Last list"
.Body = strbody
.Attachments.Add FilenameStr
.Send 'or use .Display
End With
On Error GoTo 0
'Delete the pdf you send
Kill FilenameStr
Set OutMail = Nothing
Set OutApp = Nothing
Else
MsgBox "PDF add-in Not Installed"
End If
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Sending PDF with Outlook

Hi Kan

See
http://www.rondebruin.nl/mail/tips2.htm



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Kari" wrote in message ...
Hi,

I'm using Ron de Bruin's "Mail_ActiveSheet_PDF_Outlook" macro.
How I must to change the code that macro go to pick addresses from table
data from column J
and stop receiving mail when there is no anymore addresses in column J in
table data?

Greetings,
Kari


Sub Mail_ActiveSheet_PDF_Outlook()
'Note: It is easy to change the code to send a workbook, selection or range.
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim FilenameStr As String
If Dir(Environ("commonprogramfiles") & "\Microsoft Shared\OFFICE" _
& Format(Val(Application.Version), "00") & "\EXP_PDF.DLL") < "" Then
FilenameStr = Application.DefaultFilePath & "\" & _
Format(Now, "dd-mmm-yy") & ".pdf"
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=FilenameStr, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
strbody = "Hello" & vbNewLine & vbNewLine & _
"Here is to you latest attachment" & vbNewLine & _
vbNewLine & "t. Kari"
On Error Resume Next
With OutMail
.To = "here comes data from table data column J"
.CC = ""
.BCC = ""
.Subject = "Last list"
.Body = strbody
.Attachments.Add FilenameStr
.Send 'or use .Display
End With
On Error GoTo 0
'Delete the pdf you send
Kill FilenameStr
Set OutMail = Nothing
Set OutApp = Nothing
Else
MsgBox "PDF add-in Not Installed"
End If
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending Excel through Outlook MsNat Excel Discussion (Misc queries) 1 October 21st 09 10:11 PM
Sending notifications through outlook Doberman Excel Discussion (Misc queries) 2 May 6th 07 04:26 PM
sending mails using outlook Bart van den Burg Excel Programming 1 November 11th 04 12:51 PM
Sending Appointments via Outlook Paul Thompson Excel Programming 3 April 14th 04 12:47 AM
sending outlook mail bilal Excel Programming 1 July 25th 03 01:16 PM


All times are GMT +1. The time now is 11:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"