Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mailmerge to a recipient and carbon copy address!!

Status
Not open for further replies.

MattBegg

Programmer
Jan 19, 2001
42
CA
Hi I have written a procedure below to open an instance of word based on a rtf document with merge field saved.

I am looking for a way to send to another email address at the same time ie Cc.

I do not seem to be able to find anything in help

Here is the code

Public Sub sendemail(recipient As String, cc As String, subject As String, stage As Integer)

Dim wordmerge As Word.Application
On Error GoTo mergeerr

If wordmerge Is Nothing Then
Set wordmerge = CreateObject("word.application")
End If

wordmerge.Documents.Open App.path & "\merge\stage" & stage & ".rtf"

wordmerge.Visible = True

Options.SendMailAttach = False

With ActiveDocument.MailMerge
.SuppressBlankLines = True
.MailAddressFieldName = recipient
.MailSubject = subject
.Destination = wdSendToEmail
.Execute
End With

wordmerge.Application.Visible = False
Set wordmerge = Nothing
Screen.MousePointer = vbDefault
Exit Sub

mergeerr:
MsgBox Err.Description, , Err.Number
Screen.MousePointer = vbDefault

End Sub

when the procedure is called the recipient, Cc, subject and stage are taken from a database but that is not important here.

Any help would be much appreciated Regards

Matt

matt@begg-uk.co.uk
 
Sorted it out :) Regards

Matt

matt@begg-uk.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top