![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi everyone,
I use mailmerge in word to create email messages for different recipients but the problem i have is after I create the merged document it automatically sends the emails to each recipient I wonder if there is way to send thoses emails to my drafts folder because I want to attach some files o each email and then send them manually, It's okay if the soultion needs VBA becasue Im familiar with VBA . -- Best regards, Edward |
Ads |
#2
|
|||
|
|||
![]()
Why not use VBA to attach the files to the email? There's an
Attachments.Add property in Outlook, there should be similar property in Word. HTH, JP On Nov 13, 6:36 pm, Edward wrote: Hi everyone, I use mailmerge in word to create email messages for different recipients but the problem i have is after I create the merged document it automatically sends the emails to each recipient I wonder if there is way to send thoses emails to my drafts folder because I want to attach some files o each email and then send them manually, It's okay if the soultion needs VBA becasue Im familiar with VBA . -- Best regards, Edward |
#3
|
|||
|
|||
![]()
Thanks JP but how is it possible to use attachment during mailmerge ? I want
to attach a specific file to each email lets say for Mr. X attach X.pdf and Mr. Y attach Y.pdf ,... -- Best regards, Edward "JP" wrote: Why not use VBA to attach the files to the email? There's an Attachments.Add property in Outlook, there should be similar property in Word. HTH, JP On Nov 13, 6:36 pm, Edward wrote: Hi everyone, I use mailmerge in word to create email messages for different recipients but the problem i have is after I create the merged document it automatically sends the emails to each recipient I wonder if there is way to send thoses emails to my drafts folder because I want to attach some files o each email and then send them manually, It's okay if the soultion needs VBA becasue Im familiar with VBA . -- Best regards, Edward |
#4
|
|||
|
|||
![]()
You can't. You would need to use Outlook automation, not Word mail merge, to create individual messages and attach the files.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Edward" wrote in message ... Thanks JP but how is it possible to use attachment during mailmerge ? I want to attach a specific file to each email lets say for Mr. X attach X.pdf and Mr. Y attach Y.pdf ,... -- Best regards, Edward "JP" wrote: Why not use VBA to attach the files to the email? There's an Attachments.Add property in Outlook, there should be similar property in Word. HTH, JP On Nov 13, 6:36 pm, Edward wrote: Hi everyone, I use mailmerge in word to create email messages for different recipients but the problem i have is after I create the merged document it automatically sends the emails to each recipient I wonder if there is way to send thoses emails to my drafts folder because I want to attach some files o each email and then send them manually, It's okay if the soultion needs VBA becasue Im familiar with VBA . -- Best regards, Edward |
#5
|
|||
|
|||
![]()
Sue is right. You may need to re-write your routine to use Outlook to
attach the messages. I use Excel to find the attachment, open Word and do the mail merge, then tell Outlook to craft a msg and send it out with the attachment. If you use a unique filename to identify each recipient, you can tell Outlook to include the appropriate attachment. Here is a sample of what I use (heavily scrubbed to protect the innocent). Dim FName As String, sRecipName As String, X As String Dim Outlook As Outlook.Application Dim OutlookMsg As Outlook.MailItem Dim OutlookRecip As Outlook.Recipient Dim OutlookAttach As Outlook.Attachment FName = Dir("C:\Documents And Settings\jsmith\Desktop\*.doc") On Error Resume Next Set Outlook = GetObject("outlook.application") If Err.Number 0 Then Set Outlook = CreateObject("outlook.application") End If On Error GoTo 0 Do While Len(FName) 0 ' this uses the filename to identify the recipient ' i.e. if the filename is johnsmith.doc then X would = "johnsmith" X = Left(FName, WorksheetFunction.Find(".", X) - 1) Set OutlookMsg = Outlook.CreateItem(olMailItem) With OutlookMsg .SentOnBehalfOfName = " .ReplyRecipients.Add ") .Subject = "Please review the attachment, it is customized for your location." .Importance = olImportanceHigh .Sensitivity = olConfidential .BodyFormat = olFormatHTML .HTMLBody = "pHere's the file you asked for " & _ " to review prior to our meeting./pbrpPlease send me your feedback./p" Select Case X Case "johnsmith" sRecipName = " Case "maryjones" sRecipName = " Case "robertsmith" sRecipname = " ' add additional case statements here as needed to identify the recipient Case Else End Select Set OutlookRecip = .Recipients.Add(sRecipName) OutlookRecip.Type = olTo ' this attaches the correct file for the correct recipient Set OutlookAttach = .Attachments.Add("C:\Documents And Settings\jsmith\Desktop\" & FName) .Send ' or .Display FName = Dir End With Loop Set OutlookRecip = Nothing Set OutlookAttach = Nothing Set OutlookMsg = Nothing Set Outlook = Nothing You would need to do your mail merge in Excel or Word and have the program name the files with a unique filename (location code, recipient name, etc) that you could use to identify the recipient. Assuming you did your mail merge and placed all the files on the desktop, the variable FName uses Dir to get the first desktop file that ends in .doc. Then it takes the filename and uses it to determine the correct recipient (The "Select Case" statement) and attaches the .doc to the email. Beware Outlook security warning! HTH, JP On Nov 14, 6:53 am, Edward wrote: Thanks JP but how is it possible to use attachment during mailmerge ? I want to attach a specific file to each email lets say for Mr. X attach X.pdf and Mr. Y attach Y.pdf ,... -- Best regards, Edward "JP" wrote: Why not use VBA to attach the files to the email? There's an Attachments.Add property in Outlook, there should be similar property in Word. HTH, JP |
#6
|
|||
|
|||
![]()
Trying to follow but I get lost. I am trying to attach a word.doc to all
entries in a contact group in outlook Have never tryed this befor. Your code gives me a start Thanks "JP" wrote: Sue is right. You may need to re-write your routine to use Outlook to attach the messages. I use Excel to find the attachment, open Word and do the mail merge, then tell Outlook to craft a msg and send it out with the attachment. If you use a unique filename to identify each recipient, you can tell Outlook to include the appropriate attachment. Here is a sample of what I use (heavily scrubbed to protect the innocent). Dim FName As String, sRecipName As String, X As String Dim Outlook As Outlook.Application Dim OutlookMsg As Outlook.MailItem Dim OutlookRecip As Outlook.Recipient Dim OutlookAttach As Outlook.Attachment FName = Dir("C:\Documents And Settings\jsmith\Desktop\*.doc") On Error Resume Next Set Outlook = GetObject("outlook.application") If Err.Number 0 Then Set Outlook = CreateObject("outlook.application") End If On Error GoTo 0 Do While Len(FName) 0 ' this uses the filename to identify the recipient ' i.e. if the filename is johnsmith.doc then X would = "johnsmith" X = Left(FName, WorksheetFunction.Find(".", X) - 1) Set OutlookMsg = Outlook.CreateItem(olMailItem) With OutlookMsg .SentOnBehalfOfName = " .ReplyRecipients.Add ") .Subject = "Please review the attachment, it is customized for your location." .Importance = olImportanceHigh .Sensitivity = olConfidential .BodyFormat = olFormatHTML .HTMLBody = "pHere's the file you asked for " & _ " to review prior to our meeting./pbrpPlease send me your feedback./p" Select Case X Case "johnsmith" sRecipName = " Case "maryjones" sRecipName = " Case "robertsmith" sRecipname = " ' add additional case statements here as needed to identify the recipient Case Else End Select Set OutlookRecip = .Recipients.Add(sRecipName) OutlookRecip.Type = olTo ' this attaches the correct file for the correct recipient Set OutlookAttach = .Attachments.Add("C:\Documents And Settings\jsmith\Desktop\" & FName) .Send ' or .Display FName = Dir End With Loop Set OutlookRecip = Nothing Set OutlookAttach = Nothing Set OutlookMsg = Nothing Set Outlook = Nothing You would need to do your mail merge in Excel or Word and have the program name the files with a unique filename (location code, recipient name, etc) that you could use to identify the recipient. Assuming you did your mail merge and placed all the files on the desktop, the variable FName uses Dir to get the first desktop file that ends in .doc. Then it takes the filename and uses it to determine the correct recipient (The "Select Case" statement) and attaches the .doc to the email. Beware Outlook security warning! HTH, JP On Nov 14, 6:53 am, Edward wrote: Thanks JP but how is it possible to use attachment during mailmerge ? I want to attach a specific file to each email lets say for Mr. X attach X.pdf and Mr. Y attach Y.pdf ,... -- Best regards, Edward "JP" wrote: Why not use VBA to attach the files to the email? There's an Attachments.Add property in Outlook, there should be similar property in Word. HTH, JP |
#7
|
|||
|
|||
![]() Quote:
Then perform your mail-merge as usual, and the emails will be created in your Outbox. Simply drag them from there to your Drafts folder, and attach your files. Cheers, Dave. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Attach documents to mail merged emails based on merge fields | bony_tony | Outlook and VBA | 1 | June 20th 07 12:52 PM |
Folder List and Mail Merge | Kevin Gal | Outlook - Using Contacts | 9 | November 2nd 06 12:31 AM |
How to direct output from Word mail merge to multiple Word documents | [email protected] | Outlook - General Queries | 3 | August 11th 06 05:10 AM |
Mail Merge from Outlook opens up two MS Word documents. | [email protected] | Outlook - General Queries | 10 | July 6th 06 10:44 PM |
How to direct mail to specific folder | crapit | Outlook - General Queries | 2 | May 16th 06 03:47 AM |