Advertisement

09.25.2007 at 11:19AM PDT, ID: 22851793
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

Automating email from access as both embbeded email AND attachment

Asked by vpradmin in Microsoft Access Database, Access Forms

Tags: , ,

Okay, I've been pouring over the articles from Experts Exchange in regards to automating an Email Merge from Microsoft Access. However all of the examples given show you how to send an email EITHER as an attachment. or as an embedded email (in other words take a Word Document and merge it into the body of an email), but none of these methods show you how to do BOTH (and sending plain text in the body of the email in not an option, I need it to be another Word Document).

This is exactly what I want to do.

1--I have two Word Documents that have the merge fields already set up in them and both use the same datasource.
2--Within Access I want the user to open a form, select their datasource from a combo box, type a subject into a text box, and then hit a button.
3--The code will then merge the data into both Word documents and take one of the Word documents and make it the body of an email message.
4--It will also attach the second Word document to the SAME email and send it as an attachment.

I've been able to do the first 3 steps with the code below, but I'm  not sure how to do step number 4 (somehow I don't think creating an "objWord2" would attach the second Word document to the same email message). Any help is much appreicated. Thanks!

Sub MergeEmail()
         Dim objWord As Object
         Dim strEmbeddedLetterPath As String 'Path to letter that will be body of email message
         Dim strAttachedLetterPath As String 'Path to letter that will be attachment
         Dim strDBPath As String 'Path to database
         Dim strSubject As String 'Subject of email
         Dim strDataSource As String 'Name of query selected
         
         strDataSource = Me.cmbDataSource 'Data source chosen from combo box
         strSubject = Me.txtSubject
         strEmbeddedLetterPath = "g:\Documents and Settings\jbeverid\Desktop\UGS Contacts\TestLetterEmbedded.doc"
         strAttachedLetterPath = "g:\Documents and Settings\jbeverid\Desktop\UGS Contacts\TestLetterAttachment.doc"
         strDBPath = "g:\Documents and Settings\jbeverid\Desktop\UGS Contacts\UGS Contacts Database.mdb"
         
         Set objWord = GetObject(strEmbeddedLetterPath, "Word.Document")
       
       
         ' Make Word visible.
         objWord.Application.Visible = True
         ' Set the mail merge data source
         objWord.MailMerge.OpenDataSource Name:=strDBPath, _
            LinkToSource:=True, AddToRecentFiles:=False, Connection:="QUERY " & strDataSource
         
         ' Execute the mail merge.
         objWord.MailMerge.MailSubject = strSubject      
         objWord.MailMerge.MailFormat = wdMailFormatHTML
         objWord.MailMerge.MailAddressFieldName = "Email"
         objWord.MailMerge.Destination = wdSendToEmail
         objWord.MailMerge.Execute
         
       
End Sub



Start Free Trial
 
Loading Advertisement...
 
[+][-]09.25.2007 at 07:59PM PDT, ID: 19960412

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.26.2007 at 01:11PM PDT, ID: 19966360

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.26.2007 at 03:05PM PDT, ID: 19967112

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.26.2007 at 06:07PM PDT, ID: 19968071

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.27.2007 at 02:11PM PDT, ID: 19974806

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.27.2007 at 02:18PM PDT, ID: 19974852

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.28.2007 at 06:37AM PDT, ID: 19978530

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.01.2007 at 04:40PM PDT, ID: 19995204

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.02.2007 at 08:16AM PDT, ID: 19999279

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.02.2007 at 01:48PM PDT, ID: 20001957

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.02.2007 at 01:51PM PDT, ID: 20001983

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.03.2007 at 12:29PM PDT, ID: 20009312

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.03.2007 at 01:23PM PDT, ID: 20009735

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Access Database, Access Forms
Tags: access, email, attach
Sign Up Now!
Solution Provided By: kelvinsparks
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_1_20070628