Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Sneding email thru VBA (using Exchange)

I have seen references to using VBA in Excel to send sheets/books to
recipients. Usually questions are directed to Ron deBruin's site
(http://www.rondebruin.nl/cdo.htm). However I have two issues.

[1] I am sending using an exchange server and the references are for using
SMTP. How is using an Exchange Server different?

[2] I'd like to send the file as an attachment but could not find info on
how to accomplish this. Should I need go to the Outlook forum? (I want to
send the files from within my Excel VBA programming).
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Sneding email thru VBA (using Exchange)

Hi Bigfoot17

1: ask your IT department for the server name

2: On the CDO page there is a download with examples


--

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


"Bigfoot17" wrote in message ...
I have seen references to using VBA in Excel to send sheets/books to
recipients. Usually questions are directed to Ron deBruin's site
(http://www.rondebruin.nl/cdo.htm). However I have two issues.

[1] I am sending using an exchange server and the references are for using
SMTP. How is using an Exchange Server different?

[2] I'd like to send the file as an attachment but could not find info on
how to accomplish this. Should I need go to the Outlook forum? (I want to
send the files from within my Excel VBA programming).

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Sneding email thru VBA (using Exchange)

..
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Sneding email thru VBA (using Exchange)


Hi,
add references : microsoft outlook xxxx object library

if you want to send your shet mail body use this code :

Sub mailsend()
' Requires reference to Microsoft Outlook
Dim ws As Worksheet, env As MsoEnvelope, mi As MailItem
' Get the active worksheet.
Set ws = ActiveSheet
' Save the workbook before mailing as attachment.
ws.Parent.Save
' Show email header.
ws.Parent.EnvelopeVisible = True
' Get the MsoEnvelope object
Set env = ws.MailEnvelope
' Set the email header fields.
' env.Introduction = "Please revew attached file."
' Get the MailItem object.
Set mi = env.Item
' Clear the MailItem properties.
ClearMessage mi
' Set MailItem properties.
mi.Importance = olImportanceHigh
' Set MailItem properties ImportanceHigh.
mi.SentOnBehalfOfName = "
' Set MailItem sender if use different sender.
mi.To = "
mi.CC = "
mi.Subject = "Subject text in here"
' Attach this workbook.
mi.Attachments.Add "d:\sample.pdf" ''ThisWorkbook.FullName
' Uncomment this to send automatically.
mi.Send
End Sub

and if you want to send your any document, use :

mi.Attachments.Add
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
Gift Exchange Help! Marina B Excel Worksheet Functions 1 December 6th 07 10:22 PM
Exchange Rates Michael Excel Programming 2 June 22nd 07 03:04 PM
SQL variable exchange Paul Shoemaker Excel Programming 1 July 12th 06 03:37 AM
how to disable ms exchange as email preference Cathy Excel Discussion (Misc queries) 0 February 21st 06 07:44 AM
MS Exchange Macro SyrU Excel Programming 0 September 17th 04 03:12 PM


All times are GMT +1. The time now is 01:11 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"