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