A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Sending Email from Access 2007 through Outlook 2007 using template



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 16th 10, 12:49 PM posted to microsoft.public.outlook.program_vba
Simon Hughes (ICSNET UK)
external usenet poster
 
Posts: 1
Default Sending Email from Access 2007 through Outlook 2007 using template

I run a small home run I.T. Support company any have developed an Access 2007
database for all our business activities. I currently send email using a VBA
script although it does not allow me to be as flexible as I would like.

I often send emails to customers where I would like to have a good looking
email, as I have created an outlook template (oft) with our logo and the
formatting just as I want it.

An example of our requirement is to be able to add a time and date value
from an access form into one of these templates, along with initially opening
the template, then adding the email address again from a record value in the
access form.

My idea was to do it in a similar way to how we achieve sending data to a
Word 2007 template - by using bookmarks. This would allow us to preformat the
standard emails in a oft template file and then simply drop the required data
from the Access form into it at the bookmark locations.
Do you know where I can go with this, as I've spent hours crawling the
forums and have hit a wall!!

Look forward to your reply.
Ads
  #2  
Old January 16th 10, 01:45 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default Sending Email from Access 2007 through Outlook 2007 using template

An Outlook .oft file doesn't have bookmarks. You have two choices he

1) Use a Word document as the starting point, and use the code technique
shown at http://www.outlookcode.com/codedetail.aspx?id=1333 to generate the
email messages.

-or-

2) Use placeholder text in your .oft file to mark the locations where you
want to replace that placeholder text with, for example, the date and time.

#2 is easier. Just call the Replace() function on the item's HTMLBody
property as needed.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Simon Hughes (ICSNET UK)" Simon Hughes (ICSNET
wrote in message
...
I run a small home run I.T. Support company any have developed an Access
2007
database for all our business activities. I currently send email using a
VBA
script although it does not allow me to be as flexible as I would like.

I often send emails to customers where I would like to have a good looking
email, as I have created an outlook template (oft) with our logo and the
formatting just as I want it.

An example of our requirement is to be able to add a time and date value
from an access form into one of these templates, along with initially
opening
the template, then adding the email address again from a record value in
the
access form.

My idea was to do it in a similar way to how we achieve sending data to a
Word 2007 template - by using bookmarks. This would allow us to preformat
the
standard emails in a oft template file and then simply drop the required
data
from the Access form into it at the bookmark locations.
Do you know where I can go with this, as I've spent hours crawling the
forums and have hit a wall!!

Look forward to your reply.



  #3  
Old January 17th 10, 11:24 AM posted to microsoft.public.outlook.program_vba
Simon Hughes (ICSNET UK)[_2_]
external usenet poster
 
Posts: 6
Default Sending Email from Access 2007 through Outlook 2007 using temp

Hi Sue,

Thanks for your reply, very helpful.

However, I am quite new to VBA and I am a little unsure of how to code the
Replace() function and how to call the oft templete to open and inset the
email address.

I ok with calling a new email message and sending the to,cc,bbc, subject and
body and even HTMLBody although not sure of the replace function.

Could you help at all, maybe you have an example that you have worked with
previously to point me in the right direction?

Thanks in advance.

Simon



"Sue Mosher [MVP]" wrote:

An Outlook .oft file doesn't have bookmarks. You have two choices he

1) Use a Word document as the starting point, and use the code technique
shown at http://www.outlookcode.com/codedetail.aspx?id=1333 to generate the
email messages.

-or-

2) Use placeholder text in your .oft file to mark the locations where you
want to replace that placeholder text with, for example, the date and time.

#2 is easier. Just call the Replace() function on the item's HTMLBody
property as needed.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Simon Hughes (ICSNET UK)" Simon Hughes (ICSNET
wrote in message
...
I run a small home run I.T. Support company any have developed an Access
2007
database for all our business activities. I currently send email using a
VBA
script although it does not allow me to be as flexible as I would like.

I often send emails to customers where I would like to have a good looking
email, as I have created an outlook template (oft) with our logo and the
formatting just as I want it.

An example of our requirement is to be able to add a time and date value
from an access form into one of these templates, along with initially
opening
the template, then adding the email address again from a record value in
the
access form.

My idea was to do it in a similar way to how we achieve sending data to a
Word 2007 template - by using bookmarks. This would allow us to preformat
the
standard emails in a oft template file and then simply drop the required
data
from the Access form into it at the bookmark locations.
Do you know where I can go with this, as I've spent hours crawling the
forums and have hit a wall!!

Look forward to your reply.



.

  #4  
Old January 17th 10, 02:38 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default Sending Email from Access 2007 through Outlook 2007 using temp

To create a new message from an .oft file, use the Outlook object model's
Application.CreateItemFromTemplate() method, passing the path to the .oft
file as the argument.

Replace() works the same no matter what text you use it on:

updatedText = Replace(originalText, findText, replaceText)

If you have problems making that work with your variables, post your
existing code.

There's a detailed example in my book, which is available on Google Books.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Simon Hughes (ICSNET UK)"
wrote in message ...
Hi Sue,

Thanks for your reply, very helpful.

However, I am quite new to VBA and I am a little unsure of how to code the
Replace() function and how to call the oft templete to open and inset the
email address.

I ok with calling a new email message and sending the to,cc,bbc, subject
and
body and even HTMLBody although not sure of the replace function.

"Sue Mosher [MVP]" wrote:

An Outlook .oft file doesn't have bookmarks. You have two choices he

1) Use a Word document as the starting point, and use the code technique
shown at http://www.outlookcode.com/codedetail.aspx?id=1333 to generate
the
email messages.

-or-

2) Use placeholder text in your .oft file to mark the locations where you
want to replace that placeholder text with, for example, the date and
time.

#2 is easier. Just call the Replace() function on the item's HTMLBody
property as needed.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Simon Hughes (ICSNET UK)" Simon Hughes (ICSNET
wrote in message
...
I run a small home run I.T. Support company any have developed an Access
2007
database for all our business activities. I currently send email using
a
VBA
script although it does not allow me to be as flexible as I would like.

I often send emails to customers where I would like to have a good
looking
email, as I have created an outlook template (oft) with our logo and
the
formatting just as I want it.

An example of our requirement is to be able to add a time and date
value
from an access form into one of these templates, along with initially
opening
the template, then adding the email address again from a record value
in
the
access form.

My idea was to do it in a similar way to how we achieve sending data to
a
Word 2007 template - by using bookmarks. This would allow us to
preformat
the
standard emails in a oft template file and then simply drop the
required
data
from the Access form into it at the bookmark locations.
Do you know where I can go with this, as I've spent hours crawling the
forums and have hit a wall!!

Look forward to your reply.



.



  #5  
Old January 19th 10, 07:39 PM posted to microsoft.public.outlook.program_vba
Simon Hughes (ICSNET UK)[_2_]
external usenet poster
 
Posts: 6
Default Sending Email from Access 2007 through Outlook 2007 using temp

Hi Sue,

I appreciate your reply. I have just bought your book from Amazon am I am
expecting deliver on Thursday. Hopefully I can learn a thing or two from it !!

Which part of the book contains the sample code relating to my query?

Simon

"Sue Mosher [MVP]" wrote:

To create a new message from an .oft file, use the Outlook object model's
Application.CreateItemFromTemplate() method, passing the path to the .oft
file as the argument.

Replace() works the same no matter what text you use it on:

updatedText = Replace(originalText, findText, replaceText)

If you have problems making that work with your variables, post your
existing code.

There's a detailed example in my book, which is available on Google Books.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Simon Hughes (ICSNET UK)"
wrote in message ...
Hi Sue,

Thanks for your reply, very helpful.

However, I am quite new to VBA and I am a little unsure of how to code the
Replace() function and how to call the oft templete to open and inset the
email address.

I ok with calling a new email message and sending the to,cc,bbc, subject
and
body and even HTMLBody although not sure of the replace function.

"Sue Mosher [MVP]" wrote:

An Outlook .oft file doesn't have bookmarks. You have two choices he

1) Use a Word document as the starting point, and use the code technique
shown at http://www.outlookcode.com/codedetail.aspx?id=1333 to generate
the
email messages.

-or-

2) Use placeholder text in your .oft file to mark the locations where you
want to replace that placeholder text with, for example, the date and
time.

#2 is easier. Just call the Replace() function on the item's HTMLBody
property as needed.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Simon Hughes (ICSNET UK)" Simon Hughes (ICSNET
wrote in message
...
I run a small home run I.T. Support company any have developed an Access
2007
database for all our business activities. I currently send email using
a
VBA
script although it does not allow me to be as flexible as I would like.

I often send emails to customers where I would like to have a good
looking
email, as I have created an outlook template (oft) with our logo and
the
formatting just as I want it.

An example of our requirement is to be able to add a time and date
value
from an access form into one of these templates, along with initially
opening
the template, then adding the email address again from a record value
in
the
access form.

My idea was to do it in a similar way to how we achieve sending data to
a
Word 2007 template - by using bookmarks. This would allow us to
preformat
the
standard emails in a oft template file and then simply drop the
required
data
from the Access form into it at the bookmark locations.
Do you know where I can go with this, as I've spent hours crawling the
forums and have hit a wall!!

Look forward to your reply.


.



.

  #6  
Old January 19th 10, 08:12 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default Sending Email from Access 2007 through Outlook 2007 using temp

17.4.2 - Creating a message from a boilerplate template

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Simon Hughes (ICSNET UK)"
wrote in message ...
Hi Sue,

I appreciate your reply. I have just bought your book from Amazon am I am
expecting deliver on Thursday. Hopefully I can learn a thing or two from
it !!

Which part of the book contains the sample code relating to my query?

Simon

"Sue Mosher [MVP]" wrote:

To create a new message from an .oft file, use the Outlook object model's
Application.CreateItemFromTemplate() method, passing the path to the .oft
file as the argument.

Replace() works the same no matter what text you use it on:

updatedText = Replace(originalText, findText, replaceText)

If you have problems making that work with your variables, post your
existing code.

There's a detailed example in my book, which is available on Google
Books.

"Simon Hughes (ICSNET UK)"

wrote in message
...
Hi Sue,

Thanks for your reply, very helpful.

However, I am quite new to VBA and I am a little unsure of how to code
the
Replace() function and how to call the oft templete to open and inset
the
email address.

I ok with calling a new email message and sending the to,cc,bbc,
subject
and
body and even HTMLBody although not sure of the replace function.

"Sue Mosher [MVP]" wrote:

An Outlook .oft file doesn't have bookmarks. You have two choices
he

1) Use a Word document as the starting point, and use the code
technique
shown at http://www.outlookcode.com/codedetail.aspx?id=1333 to
generate
the
email messages.

-or-

2) Use placeholder text in your .oft file to mark the locations where
you
want to replace that placeholder text with, for example, the date and
time.

#2 is easier. Just call the Replace() function on the item's HTMLBody
property as needed.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Simon Hughes (ICSNET UK)" Simon Hughes (ICSNET
wrote in message
...
I run a small home run I.T. Support company any have developed an
Access
2007
database for all our business activities. I currently send email
using
a
VBA
script although it does not allow me to be as flexible as I would
like.

I often send emails to customers where I would like to have a good
looking
email, as I have created an outlook template (oft) with our logo and
the
formatting just as I want it.

An example of our requirement is to be able to add a time and date
value
from an access form into one of these templates, along with
initially
opening
the template, then adding the email address again from a record
value
in
the
access form.

My idea was to do it in a similar way to how we achieve sending data
to
a
Word 2007 template - by using bookmarks. This would allow us to
preformat
the
standard emails in a oft template file and then simply drop the
required
data
from the Access form into it at the bookmark locations.
Do you know where I can go with this, as I've spent hours crawling
the
forums and have hit a wall!!

Look forward to your reply.


.



.



  #7  
Old February 3rd 10, 10:42 PM posted to microsoft.public.outlook.program_vba
Simon Hughes (ICSNET UK)[_2_]
external usenet poster
 
Posts: 6
Default Sending Email from Access 2007 through Outlook 2007 using temp

Hi Sue,

I have been reading through your book although I seem unable to grasp the
idea of writing the VBA for opening a oft file and utilising the replace
function.

I want to be able to send an email address to the email once the vba has
opened it, then replace some data with data from a MS Access form which is
where the vba is going to be initiated from.

Could you help at all?

Simon

"Sue Mosher [MVP]" wrote:

17.4.2 - Creating a message from a boilerplate template

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Simon Hughes (ICSNET UK)"
wrote in message ...
Hi Sue,

I appreciate your reply. I have just bought your book from Amazon am I am
expecting deliver on Thursday. Hopefully I can learn a thing or two from
it !!

Which part of the book contains the sample code relating to my query?

Simon

"Sue Mosher [MVP]" wrote:

To create a new message from an .oft file, use the Outlook object model's
Application.CreateItemFromTemplate() method, passing the path to the .oft
file as the argument.

Replace() works the same no matter what text you use it on:

updatedText = Replace(originalText, findText, replaceText)

If you have problems making that work with your variables, post your
existing code.

There's a detailed example in my book, which is available on Google
Books.

"Simon Hughes (ICSNET UK)"

wrote in message
...
Hi Sue,

Thanks for your reply, very helpful.

However, I am quite new to VBA and I am a little unsure of how to code
the
Replace() function and how to call the oft templete to open and inset
the
email address.

I ok with calling a new email message and sending the to,cc,bbc,
subject
and
body and even HTMLBody although not sure of the replace function.

"Sue Mosher [MVP]" wrote:

An Outlook .oft file doesn't have bookmarks. You have two choices
he

1) Use a Word document as the starting point, and use the code
technique
shown at http://www.outlookcode.com/codedetail.aspx?id=1333 to
generate
the
email messages.

-or-

2) Use placeholder text in your .oft file to mark the locations where
you
want to replace that placeholder text with, for example, the date and
time.

#2 is easier. Just call the Replace() function on the item's HTMLBody
property as needed.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Simon Hughes (ICSNET UK)" Simon Hughes (ICSNET
wrote in message
...
I run a small home run I.T. Support company any have developed an
Access
2007
database for all our business activities. I currently send email
using
a
VBA
script although it does not allow me to be as flexible as I would
like.

I often send emails to customers where I would like to have a good
looking
email, as I have created an outlook template (oft) with our logo and
the
formatting just as I want it.

An example of our requirement is to be able to add a time and date
value
from an access form into one of these templates, along with
initially
opening
the template, then adding the email address again from a record
value
in
the
access form.

My idea was to do it in a similar way to how we achieve sending data
to
a
Word 2007 template - by using bookmarks. This would allow us to
preformat
the
standard emails in a oft template file and then simply drop the
required
data
from the Access form into it at the bookmark locations.
Do you know where I can go with this, as I've spent hours crawling
the
forums and have hit a wall!!

Look forward to your reply.


.



.



.

  #8  
Old February 3rd 10, 11:04 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default Sending Email from Access 2007 through Outlook 2007 using temp

Do you have some particular questions? If not, then perhaps you should
implement the specific example in the book and step through its code in the
debugger, so you can get a better sense of how it all comes together.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Simon Hughes (ICSNET UK)"
wrote in message ...
Hi Sue,

I have been reading through your book although I seem unable to grasp the
idea of writing the VBA for opening a oft file and utilising the replace
function.

I want to be able to send an email address to the email once the vba has
opened it, then replace some data with data from a MS Access form which is
where the vba is going to be initiated from.

Could you help at all?

Simon

"Sue Mosher [MVP]" wrote:

17.4.2 - Creating a message from a boilerplate template

"Simon Hughes (ICSNET UK)"

wrote in message
...
Hi Sue,

I appreciate your reply. I have just bought your book from Amazon am I
am
expecting deliver on Thursday. Hopefully I can learn a thing or two
from
it !!

Which part of the book contains the sample code relating to my query?

Simon

"Sue Mosher [MVP]" wrote:

To create a new message from an .oft file, use the Outlook object
model's
Application.CreateItemFromTemplate() method, passing the path to the
.oft
file as the argument.

Replace() works the same no matter what text you use it on:

updatedText = Replace(originalText, findText, replaceText)

If you have problems making that work with your variables, post your
existing code.

There's a detailed example in my book, which is available on Google
Books.

"Simon Hughes (ICSNET UK)"

wrote in message
...
Hi Sue,

Thanks for your reply, very helpful.

However, I am quite new to VBA and I am a little unsure of how to
code
the
Replace() function and how to call the oft templete to open and
inset
the
email address.

I ok with calling a new email message and sending the to,cc,bbc,
subject
and
body and even HTMLBody although not sure of the replace function.

"Sue Mosher [MVP]" wrote:

An Outlook .oft file doesn't have bookmarks. You have two choices
he

1) Use a Word document as the starting point, and use the code
technique
shown at http://www.outlookcode.com/codedetail.aspx?id=1333 to
generate
the
email messages.

-or-

2) Use placeholder text in your .oft file to mark the locations
where
you
want to replace that placeholder text with, for example, the date
and
time.

#2 is easier. Just call the Replace() function on the item's
HTMLBody
property as needed.

"Simon Hughes (ICSNET UK)" Simon Hughes (ICSNET
wrote in message
...
I run a small home run I.T. Support company any have developed an
Access
2007
database for all our business activities. I currently send email
using
a
VBA
script although it does not allow me to be as flexible as I would
like.

I often send emails to customers where I would like to have a
good
looking
email, as I have created an outlook template (oft) with our logo
and
the
formatting just as I want it.

An example of our requirement is to be able to add a time and
date
value
from an access form into one of these templates, along with
initially
opening
the template, then adding the email address again from a record
value
in
the
access form.

My idea was to do it in a similar way to how we achieve sending
data
to
a
Word 2007 template - by using bookmarks. This would allow us to
preformat
the
standard emails in a oft template file and then simply drop the
required
data
from the Access form into it at the bookmark locations.
Do you know where I can go with this, as I've spent hours
crawling
the
forums and have hit a wall!!

Look forward to your reply.



  #9  
Old February 5th 10, 01:22 PM posted to microsoft.public.outlook.program_vba
Simon Hughes (ICSNET UK)[_2_]
external usenet poster
 
Posts: 6
Default Sending Email from Access 2007 through Outlook 2007 using temp

Hi Sue,

Sorry for the unclear question.

What I was getting at was, the article in the book seemed to be aimed at
programatically replying to an email already received rather than generating
a new message from VBA in Access and inserting data from the DB into the
email template that I somehow need to open from VBA.

Hope this is a little clearer.

Regards,

Simon Hughes
ICSNET UK
t: 01495 70 80 90
m: 07747 41 41 41



"Sue Mosher [MVP]" wrote:

Do you have some particular questions? If not, then perhaps you should
implement the specific example in the book and step through its code in the
debugger, so you can get a better sense of how it all comes together.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Simon Hughes (ICSNET UK)"
wrote in message ...
Hi Sue,

I have been reading through your book although I seem unable to grasp the
idea of writing the VBA for opening a oft file and utilising the replace
function.

I want to be able to send an email address to the email once the vba has
opened it, then replace some data with data from a MS Access form which is
where the vba is going to be initiated from.

Could you help at all?

Simon

"Sue Mosher [MVP]" wrote:

17.4.2 - Creating a message from a boilerplate template

"Simon Hughes (ICSNET UK)"

wrote in message
...
Hi Sue,

I appreciate your reply. I have just bought your book from Amazon am I
am
expecting deliver on Thursday. Hopefully I can learn a thing or two
from
it !!

Which part of the book contains the sample code relating to my query?

Simon

"Sue Mosher [MVP]" wrote:

To create a new message from an .oft file, use the Outlook object
model's
Application.CreateItemFromTemplate() method, passing the path to the
.oft
file as the argument.

Replace() works the same no matter what text you use it on:

updatedText = Replace(originalText, findText, replaceText)

If you have problems making that work with your variables, post your
existing code.

There's a detailed example in my book, which is available on Google
Books.

"Simon Hughes (ICSNET UK)"

wrote in message
...
Hi Sue,

Thanks for your reply, very helpful.

However, I am quite new to VBA and I am a little unsure of how to
code
the
Replace() function and how to call the oft templete to open and
inset
the
email address.

I ok with calling a new email message and sending the to,cc,bbc,
subject
and
body and even HTMLBody although not sure of the replace function.

"Sue Mosher [MVP]" wrote:

An Outlook .oft file doesn't have bookmarks. You have two choices
he

1) Use a Word document as the starting point, and use the code
technique
shown at http://www.outlookcode.com/codedetail.aspx?id=1333 to
generate
the
email messages.

-or-

2) Use placeholder text in your .oft file to mark the locations
where
you
want to replace that placeholder text with, for example, the date
and
time.

#2 is easier. Just call the Replace() function on the item's
HTMLBody
property as needed.

"Simon Hughes (ICSNET UK)" Simon Hughes (ICSNET
wrote in message
...
I run a small home run I.T. Support company any have developed an
Access
2007
database for all our business activities. I currently send email
using
a
VBA
script although it does not allow me to be as flexible as I would
like.

I often send emails to customers where I would like to have a
good
looking
email, as I have created an outlook template (oft) with our logo
and
the
formatting just as I want it.

An example of our requirement is to be able to add a time and
date
value
from an access form into one of these templates, along with
initially
opening
the template, then adding the email address again from a record
value
in
the
access form.

My idea was to do it in a similar way to how we achieve sending
data
to
a
Word 2007 template - by using bookmarks. This would allow us to
preformat
the
standard emails in a oft template file and then simply drop the
required
data
from the Access form into it at the bookmark locations.
Do you know where I can go with this, as I've spent hours
crawling
the
forums and have hit a wall!!

Look forward to your reply.



.

  #10  
Old February 5th 10, 02:29 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Sending Email from Access 2007 through Outlook 2007 using temp

Sue's off for a few days.

To create a brand new blank email item and have a reference available to it
for adding data from a DB your code would start like this, assuming you have
an Outlook.Application object oOL:

Dim oMail As Outlook.MailItem
Set oMail = oOL.CreateItem(olMailItem)

You then add whatever properties you want from the DB information such as
Subject or Body or HTMLBody, etc. You can get the Recipients collection of
the mail item and add one or more recipients to that, etc.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Simon Hughes (ICSNET UK)"
wrote in message ...
Hi Sue,

Sorry for the unclear question.

What I was getting at was, the article in the book seemed to be aimed at
programatically replying to an email already received rather than
generating
a new message from VBA in Access and inserting data from the DB into the
email template that I somehow need to open from VBA.

Hope this is a little clearer.

Regards,

Simon Hughes
ICSNET UK
t: 01495 70 80 90
m: 07747 41 41 41


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
automatically sending emails from MS Access 2007 toddr Outlook and VBA 9 January 21st 09 06:19 PM
Using Outlook Standard Email Template from Access VBA CaptainBly Outlook - Using Forms 3 May 22nd 08 05:32 PM
Outlook 2007 email template [email protected] Outlook - General Queries 7 April 4th 08 12:40 PM
Send email from Access using Outlook template Jerry M. Faison III Outlook and VBA 1 February 27th 08 05:44 AM
create template for sending email/outlook 2002 Coreslider Outlook - Using Contacts 2 June 23rd 06 06:28 PM


All times are GMT +1. The time now is 02:43 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.