ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Mail Merge Option (https://www.excelbanter.com/excel-programming/438495-mail-merge-option.html)

Akash

Mail Merge Option
 
Hi,

Can anyone help me in this. I know i am asking you for Microsoft
Office but if i get any solution i would be great-full.
How to send Copy of a mail to a specific id while using Mail Merge?
E.g. Mail Merge gives you a facility to send mails to respective
individual person, what i want is how to put an email id in CC
section.


Rgrds

Akash

joel[_557_]

Mail Merge Option
 

Ron De Bruin has two excellent articles on using Email with Excel and
VBA. they were so good mcrosoft put them on their webpage. See the
links below.


'Different Ways to Take Advantage of the E-mail Features of Excel'
(http://msdn.microsoft.com/en-us/libr...ffice.11).aspx)

'Working with Excel Workbooks and Worksheets in E-Mail'
(http://msdn.microsoft.com/en-us/library/bb268022.aspx)


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=170690

Microsoft Office Help


Anthony[_18_]

Mail Merge Option
 
Hi,

I found a problem when merging information from the workbook currently
running the code to mail merge and the work around was to create a back up
of the file first and use that to link in the mail merge.

Sub print_Click()

Dim FName As String
Dim appWD As Object ' Word.Application
Dim UserN As String
Dim DesktopPath As String

On Error Resume Next

Application.StatusBar = "Starting mail merge ..."

'create a backup of the current workbook to use as the mail merge file
Application.DisplayAlerts = False
ThisWorkbook.SaveCopyAs ThisWorkbook.Path & "\addresses-backup.xls"
Application.DisplayAlerts = True

FName = Dir(ThisWorkbook.Path & "\addresses-backup.xls")

If appWD Is Nothing Then
Set appWD = CreateObject("Word.Application") ' New Word.Application
End If
appWD.Documents.Open Filename:=ThisWorkbook.Path & "\label
merge-auto.doc"

With appWD.ActiveDocument.MailMerge
.OpenDataSource Name:=ThisWorkbook.Path & "\" & FName,
sqlstatement:="SELECT * FROM [print list$]"
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
.Execute Pause:=False
End With

Application.StatusBar = "Now creating document for " & Left(FName,
Len(FName) - 4)

appWD.ActiveDocument.SaveAs (ThisWorkbook.Path & "\merged" &
Format(Date, "dd-mm-yyyy") & "-week" & _
Worksheets("label order").Range("Q4").Value),
FileFormat:=wdFormatDocument
appWD.ActiveDocument.Close


appWD.Documents("label merge-auto.doc").Close savechanges:=False

appWD.Quit

Set appWD = Nothing

'remove backup file
Kill ThisWorkbook.Path & "\addresses-backup.xls"

Application.StatusBar = False

End Sub

The code is lifted from mine and it was adapted for my use from an article
online. Please use as required..

Regards

Anthony

"Akash" wrote in message
...
Hi,

Can anyone help me in this. I know i am asking you for Microsoft
Office but if i get any solution i would be great-full.
How to send Copy of a mail to a specific id while using Mail Merge?
E.g. Mail Merge gives you a facility to send mails to respective
individual person, what i want is how to put an email id in CC
section.


Rgrds

Akash




All times are GMT +1. The time now is 09:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com