Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Access

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 03-02-2010, 10:17 PM
ragsgold ragsgold is offline Windows XP Access 2000 (version 9.0)
Novice
 
Join Date: Oct 2009
Posts: 21
ragsgold is on a distinguished road
Thumbs up MS Access 2003 Mail Merge and Mailing from Outlook

Hello All,

I have a process of mass mailing to customers.I have a fixed body of letter which goes in my email (outlook 2003) along with a pdf attachment personalized to each customer.

Is there a way to email from access(2003) through Outlook(2003) with the pdf attachment. Please note the pdf attachment is personalized so when i email X customer the pdf address to X should come . I name the pdf with the customer code and the same code and email is available in access table also.

I am exploring an option for this mass mailing and also want to know how i can do mailmerge using Access presently my excel holds data and i merge it in word.

Appreciate your help

Regards
Reply With Quote
  #2  
Old 03-03-2010, 07:54 AM
pbaldy's Avatar
pbaldy pbaldy is online now Windows XP Access 2007 (version 12.0)
Who is John Galt?
 
Join Date: Feb 2010
Location: Nevada, USA
Posts: 1,223
pbaldy is on a distinguished road
Default

I do pretty much the same thing. I would use this for the PDF:

http://www.lebans.com/reporttopdf.htm

and here are some thoughts on the emailing:

Emailing a different report to each recipient
__________________
Paul
MS Access MVP
www.BaldyWeb.com
Reply With Quote
  #3  
Old 03-08-2010, 04:00 AM
ragsgold ragsgold is offline Windows XP Access 2000 (version 9.0)
Novice
 
Join Date: Oct 2009
Posts: 21
ragsgold is on a distinguished road
Default

I downloaded the access file with the DLL files from the first link I guess it can open only SNP files how do i convert a word file to pdf....

On the second link for mailing individual links it refers to code i am not good at modules or VBA how do I do this should I copy the code present in the link to a module ?

Thanks
Reply With Quote
  #4  
Old 03-08-2010, 07:04 AM
pbaldy's Avatar
pbaldy pbaldy is online now Windows XP Access 2007 (version 12.0)
Who is John Galt?
 
Join Date: Feb 2010
Location: Nevada, USA
Posts: 1,223
pbaldy is on a distinguished road
Default

I'm not sure how to send the Word doc to PDF; I always have the content in Access.

I would study the code to understand what it's doing. Then you can cut/paste the appropriate parts into your code. Feel free to ask if you can't figure out what any particular bit is doing.
__________________
Paul
MS Access MVP
www.BaldyWeb.com
Reply With Quote
  #5  
Old 03-09-2010, 07:46 AM
ragsgold ragsgold is offline Windows XP Access 2000 (version 9.0)
Novice
 
Join Date: Oct 2009
Posts: 21
ragsgold is on a distinguished road
Default

I think thats a good idea to keep the letter content in Access through forms ...that is what i tried after reading the link which you provided. I get one error "Frmmain" is missing and it points out to the line in the module (If (IsNull(Forms!frmMail!CCAddress)) Then).

But this Form is very much present but not sure why it should hive this error. below is the VBA code. ofcourse after the End sub i did a Ctrl G anfor specifing the attachment but i got the above error

Option Compare Database

Option Compare Database
Option Explicit

Sub SendMessages(Optional AttachmentPath)

Dim MyDB As Database
Dim MyRS As Recordset
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Dim TheAddress As String

Set MyDB = CurrentDb
Set MyRS = MyDB.OpenRecordset("tblMailingList")
MyRS.MoveFirst

' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")

Do Until MyRS.EOF
' Create the e-mail message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
TheAddress = MyRS![EmailAddress]

With objOutlookMsg
' Add the To recipients to the e-mail message.
Set objOutlookRecip = .Recipients.Add(TheAddress)
objOutlookRecip.Type = olTo

' Add the Cc recipients to the e-mail message.
If (IsNull(Forms!frmMail!CCAddress)) Then
Else
Set objOutlookRecip = .Recipients.Add(Forms!frmMail!CCAddress)
objOutlookRecip.Type = olCC
End If

' Set the Subject, the Body, and the Importance of the e-mail message.
.Subject = Forms!frmMail!Subject
.Body = Forms!frmMail!MainText
.Importance = olImportanceHigh 'High importance

'Add the attachment to the e-mail message.
If Not IsMissing(AttachmentPath) Then
Set objOutlookAttach = .Attachments.Add(AttachmentPath)
End If

' Resolve the name of each Recipient.
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
If Not objOutlookRecip.Resolve Then
objOutlookMsg.Display
End If
Next
.Send
End With
MyRS.MoveNext
Loop
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Sub
Reply With Quote
  #6  
Old 03-09-2010, 08:04 AM
pbaldy's Avatar
pbaldy pbaldy is online now Windows XP Access 2007 (version 12.0)
Who is John Galt?
 
Join Date: Feb 2010
Location: Nevada, USA
Posts: 1,223
pbaldy is on a distinguished road
Default

Is the form open when the code runs? It needs to be. You mentioned frmMain but I see frmMail in the code. Might be a typo, but make sure the spelling is correct.
__________________
Paul
MS Access MVP
www.BaldyWeb.com
Reply With Quote
  #7  
Old 03-09-2010, 08:24 AM
ragsgold ragsgold is offline Windows XP Access 2000 (version 9.0)
Novice
 
Join Date: Oct 2009
Posts: 21
ragsgold is on a distinguished road
Default

Yes I had kept the form open when i ran the code. Sorry it was a typo here but i its frmmail in the access file.
Reply With Quote
  #8  
Old 03-09-2010, 08:26 AM
pbaldy's Avatar
pbaldy pbaldy is online now Windows XP Access 2007 (version 12.0)
Who is John Galt?
 
Join Date: Feb 2010
Location: Nevada, USA
Posts: 1,223
pbaldy is on a distinguished road
Default

If the form is open and the form and control names are spelled correctly, I'm puzzled. Can you post the db?
__________________
Paul
MS Access MVP
www.BaldyWeb.com
Reply With Quote
  #9  
Old 03-10-2010, 10:52 PM
ragsgold ragsgold is offline Windows XP Access 2000 (version 9.0)
Novice
 
Join Date: Oct 2009
Posts: 21
ragsgold is on a distinguished road
Default Re

Hi

I had attached the access file and the empty test text file.

One more question I have is i had ket the form open and i filled the below infor

CCaddress - Dear Customer

Subject - some sub text

Main message - a para

after i close this form and reopen none of this info is saved i understand its not linked to a table ...am i making a mistake .

In the point 5 in link http://support.microsoft.com/?id=318881

form creation i saw RecordSource: tblMailingList i dint do anything for this may be is this the error ?

Thanks again for your help
Attached Files
File Type: zip Copy of Access Mailing.zip (37.4 KB, 7 views)
Reply With Quote
  #10  
Old 03-11-2010, 08:00 AM
pbaldy's Avatar
pbaldy pbaldy is online now Windows XP Access 2007 (version 12.0)
Who is John Galt?
 
Join Date: Feb 2010
Location: Nevada, USA
Posts: 1,223
pbaldy is on a distinguished road
Default

The textbox is not named "CCAddress", it's named "Text1", so the line has to be:

If (IsNull(Forms!frmMail.Text1)) Then

CCAddress is just the caption of the associated label. Same for the other two. If the form is not bound to a table, anything entered into the textboxes will be lost when the form is closed.
__________________
Paul
MS Access MVP
www.BaldyWeb.com
Reply With Quote
  #11  
Old 03-11-2010, 10:53 PM
ragsgold ragsgold is offline Windows XP Access 2000 (version 9.0)
Novice
 
Join Date: Oct 2009
Posts: 21
ragsgold is on a distinguished road
Default

Now i am getting the below line as error in yellow

Set objOutlookRecip = .Recipients.Add(Forms!frmMail!CCAddress)

will it be possible for you to fix my db with appr txt in the form and send me ....

Thanks
Reply With Quote
  #12  
Old 03-12-2010, 07:58 AM
pbaldy's Avatar
pbaldy pbaldy is online now Windows XP Access 2007 (version 12.0)
Who is John Galt?
 
Join Date: Feb 2010
Location: Nevada, USA
Posts: 1,223
pbaldy is on a distinguished road
Default

I'm actually not where I have your db working right now. It doesn't appear you changed to the actual textbox name there. You have to do that in all instances where you refer to the form.
__________________
Paul
MS Access MVP
www.BaldyWeb.com
Reply With Quote
  #13  
Old 03-13-2010, 06:32 AM
ragsgold ragsgold is offline Windows XP Access 2000 (version 9.0)
Novice
 
Join Date: Oct 2009
Posts: 21
ragsgold is on a distinguished road
Default

Finally got it now one more request ...if i want to mask the sender email ID or make it as not repliable by receipient..how can I achieve this ?
Reply With Quote
  #14  
Old 03-13-2010, 03:43 PM
pbaldy's Avatar
pbaldy pbaldy is online now Windows XP Access 2007 (version 12.0)
Who is John Galt?
 
Join Date: Feb 2010
Location: Nevada, USA
Posts: 1,223
pbaldy is on a distinguished road
Default

Not sure about masking or making not reply-able, but I use this to set the address that will show as the sender:

.SentOnBehalfOfName = "Whatever@Blah.com"
__________________
Paul
MS Access MVP
www.BaldyWeb.com
Reply With Quote
  #15  
Old 03-14-2010, 09:38 PM
ragsgold ragsgold is offline Windows XP Access 2000 (version 9.0)
Novice
 
Join Date: Oct 2009
Posts: 21
ragsgold is on a distinguished road
Default

Thanks a lot this worked and I was able to put the from sender name as desired
Reply With Quote
Reply

Bookmarks

Thread Tools
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

BB code is On
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
Mail Merge Nixx1401 Access 1 02-15-2010 07:51 AM
Mail Merge document locked when opened from Access retro Import/Export Data 0 08-14-2009 01:12 AM
Mail Merge from Access to Word Rachelkm2 Programming 1 05-29-2009 12:49 PM
Mail merge grgerhard Forms 0 04-25-2006 03:06 PM
Mail Merge problem kfergus Programming 0 04-24-2006 11:06 AM


All times are GMT -8. The time now is 08:22 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.