Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel Running Outlook VB

How can I automate emails sent by triggering links within
Excel. I would like to send a standard email to various
recipients when a date condition is met (actually an
updated forecast). Do I need to buy and install VB6 or
would I be able to run a programme in Excel that drives
my Outlook?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel Running Outlook VB


Bon

Thank you. Could I run this from Excel vba?

-----Original Message-----
David,

VBA can easily send mail via Outlook. Here is some

example code

Dim objOutlook As Object
Dim objMailItem As Object
Dim objRecipient As Object
Dim objNameSpace As Object

Set objOutlook = CreateObject

("Outlook.Application")
Set objNameSpace = objOutlook.GetNameSpace

("MAPI")
objNameSpace.Logon , , True

Set objMailItem = objOutlook.CreateItem(0)
Set objRecipient =
objMailItem.Recipients.Add("bob.phillips@somewher e.com")
objRecipient.Type = 1 '1 = To, use 2 for cc
'keep repeating these

lines with
'your names, adding to the

collection.
objMailItem.Subject = "The extract has finished."
objMailItem.Body = "This is an automatic email

notification"
objMailItem.Attachments.Add

(Filename) 'you only need this if
you are sending attachments?
objMailItem.Send

If you want to include an attachment as shown, it has to

be a file not the
activeworkbook, so if you want to send the

activeworkbbok, save it firat,
and then send it as that file. You can

use 'ActiveWorkbook.FullName' to
access it without using hard-coded values.

You just will nedd to add the code to trigger the

mailing.

--

HTH

Bob Phillips

"David Robinson" wrote in

message
...
How can I automate emails sent by triggering links

within
Excel. I would like to send a standard email to various
recipients when a date condition is met (actually an
updated forecast). Do I need to buy and install VB6 or
would I be able to run a programme in Excel that drives
my Outlook?



.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel Running Outlook VB


Does vba refer to the excel visual basic?

-----Original Message-----
David,

VBA can easily send mail via Outlook. Here is some

example code

Dim objOutlook As Object
Dim objMailItem As Object
Dim objRecipient As Object
Dim objNameSpace As Object

Set objOutlook = CreateObject

("Outlook.Application")
Set objNameSpace = objOutlook.GetNameSpace

("MAPI")
objNameSpace.Logon , , True

Set objMailItem = objOutlook.CreateItem(0)
Set objRecipient =
objMailItem.Recipients.Add("bob.phillips@somewher e.com")
objRecipient.Type = 1 '1 = To, use 2 for cc
'keep repeating these

lines with
'your names, adding to the

collection.
objMailItem.Subject = "The extract has finished."
objMailItem.Body = "This is an automatic email

notification"
objMailItem.Attachments.Add

(Filename) 'you only need this if
you are sending attachments?
objMailItem.Send

If you want to include an attachment as shown, it has to

be a file not the
activeworkbook, so if you want to send the

activeworkbbok, save it firat,
and then send it as that file. You can

use 'ActiveWorkbook.FullName' to
access it without using hard-coded values.

You just will nedd to add the code to trigger the

mailing.

--

HTH

Bob Phillips

"David Robinson" wrote in

message
...
How can I automate emails sent by triggering links

within
Excel. I would like to send a standard email to various
recipients when a date condition is met (actually an
updated forecast). Do I need to buy and install VB6 or
would I be able to run a programme in Excel that drives
my Outlook?



.

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
Outlook/Excel robzrob Excel Worksheet Functions 6 June 12th 08 11:35 AM
custimized outlook today in outlook 2007 Hal Excel Discussion (Misc queries) 2 June 20th 07 12:59 AM
excel open in outlook if outlook is running kirk Excel Discussion (Misc queries) 0 May 24th 06 06:42 PM
Send to Outlook 2000 not Outlook Express Jimbo Excel Discussion (Misc queries) 2 January 4th 05 08:19 PM
Outlook 2003 demo back to Outlook XP Pete Carr Excel Discussion (Misc queries) 1 December 22nd 04 08:04 AM


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