Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How I auto send e-mail from excel with predefined subject and tex

i'm trying autosend e-mails from excel, but need to every time outoolk opens
already shows subject and message body. The hyperlink function is part of a
formula that provides acees to outlook
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 324
Default How I auto send e-mail from excel with predefined subject and tex

Modify the Ranges and Values to suit your situation.

Dim OutApp As Outlook.Application
ThisWorkbook.Activate
Dim OutMail As Outlook.MailItem
Dim strbody As String

A = Sheets("Macros").Range("C16").Value
B = Sheets("Macros").Range("C18").Value
C = Sheets("Macros").Range("A1").Value

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
strbody = "Attached is the " & C & " CSFB Activity Report." & vbNewLine
& vbNewLine & _
"Please let me know if you have any questions."
Enclosures = wbk1

IncludeAttachments = True
With OutMail
.To = A
.CC = B
.BCC = ""
.Subject = "CSFB Activity Comparison"
.Body = strbody
.Attachments.Add Workbooks(wbk1).FullName
' .Attachments.Add Workbooks(wbk2).FullName
.Display

End With

Set OutMail = Nothing
Set OutApp = Nothing
--
Best wishes,

Jim


"sdvl" wrote:

i'm trying autosend e-mails from excel, but need to every time outoolk opens
already shows subject and message body. The hyperlink function is part of a
formula that provides acees to outlook

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How I auto send e-mail from excel with predefined subject and

I too would like to get a result from this; however i get a compile error:
user- defined type not defined.

Any suggestions?

"Jim Jackson" wrote:

Modify the Ranges and Values to suit your situation.

Dim OutApp As Outlook.Application
ThisWorkbook.Activate
Dim OutMail As Outlook.MailItem
Dim strbody As String

A = Sheets("Macros").Range("C16").Value
B = Sheets("Macros").Range("C18").Value
C = Sheets("Macros").Range("A1").Value

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
strbody = "Attached is the " & C & " CSFB Activity Report." & vbNewLine
& vbNewLine & _
"Please let me know if you have any questions."
Enclosures = wbk1

IncludeAttachments = True
With OutMail
.To = A
.CC = B
.BCC = ""
.Subject = "CSFB Activity Comparison"
.Body = strbody
.Attachments.Add Workbooks(wbk1).FullName
' .Attachments.Add Workbooks(wbk2).FullName
.Display

End With

Set OutMail = Nothing
Set OutApp = Nothing
--
Best wishes,

Jim


"sdvl" wrote:

i'm trying autosend e-mails from excel, but need to every time outoolk opens
already shows subject and message body. The hyperlink function is part of a
formula that provides acees to outlook

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How I auto send e-mail from excel with predefined subject and

Select your project in the VBE
tools|References|
look for Microsoft Outlook xx.x Object Library

and check it.

Nippy wrote:

I too would like to get a result from this; however i get a compile error:
user- defined type not defined.

Any suggestions?

"Jim Jackson" wrote:

Modify the Ranges and Values to suit your situation.

Dim OutApp As Outlook.Application
ThisWorkbook.Activate
Dim OutMail As Outlook.MailItem
Dim strbody As String

A = Sheets("Macros").Range("C16").Value
B = Sheets("Macros").Range("C18").Value
C = Sheets("Macros").Range("A1").Value

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
strbody = "Attached is the " & C & " CSFB Activity Report." & vbNewLine
& vbNewLine & _
"Please let me know if you have any questions."
Enclosures = wbk1

IncludeAttachments = True
With OutMail
.To = A
.CC = B
.BCC = ""
.Subject = "CSFB Activity Comparison"
.Body = strbody
.Attachments.Add Workbooks(wbk1).FullName
' .Attachments.Add Workbooks(wbk2).FullName
.Display

End With

Set OutMail = Nothing
Set OutApp = Nothing
--
Best wishes,

Jim


"sdvl" wrote:

i'm trying autosend e-mails from excel, but need to every time outoolk opens
already shows subject and message body. The hyperlink function is part of a
formula that provides acees to outlook


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How I auto send e-mail from excel with predefined subject and

Thank you, this is now working a treat.

Ideally i would like to start the body of the email with a line from the
workbook such as

Dear "name"

and then finish off with a standard signature from Outlook,

I could add the standard signature into the code but i don't get the nice
html effects i have in my signature

Any suggestions?


"Dave Peterson" wrote:

Select your project in the VBE
tools|References|
look for Microsoft Outlook xx.x Object Library

and check it.

Nippy wrote:

I too would like to get a result from this; however i get a compile error:
user- defined type not defined.

Any suggestions?

"Jim Jackson" wrote:

Modify the Ranges and Values to suit your situation.

Dim OutApp As Outlook.Application
ThisWorkbook.Activate
Dim OutMail As Outlook.MailItem
Dim strbody As String

A = Sheets("Macros").Range("C16").Value
B = Sheets("Macros").Range("C18").Value
C = Sheets("Macros").Range("A1").Value

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
strbody = "Attached is the " & C & " CSFB Activity Report." & vbNewLine
& vbNewLine & _
"Please let me know if you have any questions."
Enclosures = wbk1

IncludeAttachments = True
With OutMail
.To = A
.CC = B
.BCC = ""
.Subject = "CSFB Activity Comparison"
.Body = strbody
.Attachments.Add Workbooks(wbk1).FullName
' .Attachments.Add Workbooks(wbk2).FullName
.Display

End With

Set OutMail = Nothing
Set OutApp = Nothing
--
Best wishes,

Jim


"sdvl" wrote:

i'm trying autosend e-mails from excel, but need to every time outoolk opens
already shows subject and message body. The hyperlink function is part of a
formula that provides acees to outlook


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How I auto send e-mail from excel with predefined subject and

I don't. I don't use Outlook.

I'd go to Ron de Bruin's page and look through some of his sample email code.
http://www.rondebruin.nl/sendmail.htm

Nippy wrote:

Thank you, this is now working a treat.

Ideally i would like to start the body of the email with a line from the
workbook such as

Dear "name"

and then finish off with a standard signature from Outlook,

I could add the standard signature into the code but i don't get the nice
html effects i have in my signature

Any suggestions?

"Dave Peterson" wrote:

Select your project in the VBE
tools|References|
look for Microsoft Outlook xx.x Object Library

and check it.

Nippy wrote:

I too would like to get a result from this; however i get a compile error:
user- defined type not defined.

Any suggestions?

"Jim Jackson" wrote:

Modify the Ranges and Values to suit your situation.

Dim OutApp As Outlook.Application
ThisWorkbook.Activate
Dim OutMail As Outlook.MailItem
Dim strbody As String

A = Sheets("Macros").Range("C16").Value
B = Sheets("Macros").Range("C18").Value
C = Sheets("Macros").Range("A1").Value

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
strbody = "Attached is the " & C & " CSFB Activity Report." & vbNewLine
& vbNewLine & _
"Please let me know if you have any questions."
Enclosures = wbk1

IncludeAttachments = True
With OutMail
.To = A
.CC = B
.BCC = ""
.Subject = "CSFB Activity Comparison"
.Body = strbody
.Attachments.Add Workbooks(wbk1).FullName
' .Attachments.Add Workbooks(wbk2).FullName
.Display

End With

Set OutMail = Nothing
Set OutApp = Nothing
--
Best wishes,

Jim


"sdvl" wrote:

i'm trying autosend e-mails from excel, but need to every time outoolk opens
already shows subject and message body. The hyperlink function is part of a
formula that provides acees to outlook


--

Dave Peterson


--

Dave Peterson
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
Bypass: A program is trying to send mail using Item.Send prompt Vick Excel Discussion (Misc queries) 1 June 25th 09 03:31 AM
Link Worksheet and Auto send e-mail Gaz259 Excel Worksheet Functions 2 February 11th 08 09:34 PM
Send a auto mail via Notes Jatin Excel Discussion (Misc queries) 0 March 23rd 07 04:03 AM
Send Mail Merge Auto-Emails based on date Phillycheese5 Excel Programming 1 November 17th 05 03:37 PM
Auto Run Excel macro subject to condition Warrior1800 Excel Programming 1 July 23rd 05 12:10 PM


All times are GMT +1. The time now is 12:02 AM.

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

About Us

"It's about Microsoft Excel"