Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
PG PG is offline
external usenet poster
 
Posts: 8
Default MS Word 2003 Mail Merge Setting email Message to High Priority

Performing a mail merge in MS Word 2003 ...when the email messages get sent
out from Outlook I want the Importance button set to high (the red
exclamation mark). There seems to be no option to set this for the purpose of
an email merge.

Anyone?

peter
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default MS Word 2003 Mail Merge Setting email Message to High Priority

You would need to use a macro that accesses the Outlook Object Model to do
that.

You will find a lot of what you need in the article "Mail Merge to E-mail
with Attachments" at:

http://word.mvps.org/FAQs/MailMerge/...ttachments.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"pg" wrote in message
...
Performing a mail merge in MS Word 2003 ...when the email messages get
sent
out from Outlook I want the Importance button set to high (the red
exclamation mark). There seems to be no option to set this for the purpose
of
an email merge.

Anyone?

peter



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
PG PG is offline
external usenet poster
 
Posts: 8
Default MS Word 2003 Mail Merge Setting email Message to High Priority

Useful -- but complicated ! ;-)

Are there any of the below that could help me do this automatically? Even if
for a fee?:

1) add in?
2) 3rd party freeware/shareware

Thanks

pg


"Doug Robbins - Word MVP" wrote:

You would need to use a macro that accesses the Outlook Object Model to do
that.

You will find a lot of what you need in the article "Mail Merge to E-mail
with Attachments" at:

http://word.mvps.org/FAQs/MailMerge/...ttachments.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"pg" wrote in message
...
Performing a mail merge in MS Word 2003 ...when the email messages get
sent
out from Outlook I want the Importance button set to high (the red
exclamation mark). There seems to be no option to set this for the purpose
of
an email merge.

Anyone?

peter




  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default MS Word 2003 Mail Merge Setting email Message to High Priority

As the importance has to be set separately for each email message, I doubt
that there is any alternative to using vba to send each message. Of course,
there is more in the article to which I directed you than is required to do
just that, so if you want to start from the basics, see the article "How to
send an email from Word using VBA" at:

http://www.word.mvps.org/FAQs/InterDev/SendMail.htm

If I was needing to do this, I would not however use mailmerge. Rather, I
would create the equivalent of a mail merge main document in which I used
{ DOCVARIABLE } fields instead of merge fields, then I would iterate through
the data source, creating a new document for each record, and loading
document variables with the data for each record and use vba to send the
document by email.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"pg" wrote in message
...
Useful -- but complicated ! ;-)

Are there any of the below that could help me do this automatically? Even
if
for a fee?:

1) add in?
2) 3rd party freeware/shareware

Thanks

pg


"Doug Robbins - Word MVP" wrote:

You would need to use a macro that accesses the Outlook Object Model to
do
that.

You will find a lot of what you need in the article "Mail Merge to E-mail
with Attachments" at:

http://word.mvps.org/FAQs/MailMerge/...ttachments.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"pg" wrote in message
...
Performing a mail merge in MS Word 2003 ...when the email messages get
sent
out from Outlook I want the Importance button set to high (the red
exclamation mark). There seems to be no option to set this for the
purpose
of
an email merge.

Anyone?

peter






  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default MS Word 2003 Mail Merge Setting email Message to High Priority

The following macro may help. It works in a similar way to Doug's macros
(i.e. the ones he pointed you to) but is not designed to deal with the
complexities of multiple attachments and so on. It will only work if there
is one e-mail for each record in the data source. Also, I haven't tested
this specific version of the macro.

Peter Jamieson

Sub EmailOneDocPerSourceRecWithBody()
Dim bOutlookStarted As Boolean
Dim bTerminateMerge As Boolean
Dim intCurrentRecord As Integer
Dim intSourceRecord As Integer
Dim objMailItem As Outlook.MailItem
Dim objMerge As Word.MailMerge
Dim objOutlook As Outlook.Application
Dim rngEndOfDoc As Word.Range
Dim strCurrentRecordFieldText As String
Dim strMailSubject As String
Dim strMailTo As String
Dim strMailBody As String
Dim strOutputDocumentName As String

bOutlookStarted = False
bTerminateMerge = False

' Set up a reference to the
' Activedocument, partly because
' the ActiveDocument changes as you
' merge each record

Set objMailMergeMainDocument = ActiveDocument
Set objMerge = objMailMergeMainDocument.MailMerge

' Start Outlook as necessary

On Error Resume Next
Set objOutlook = GetObject(, "Outlook.Application")
If Err 0 Then
Set objOutlook = CreateObject("Outlook.Application")
bOutlookStarted = True
End If

With objMerge

' If no data source has been defined,
' do it here using OpenDataSource.
' But if it is already defined in the
' document, you should not need to
' define it here.

' .OpenDataSource _
' Name:="whatever"

intSourceRecord = 1

Do Until bTerminateMerge
.DataSource.ActiveRecord = intSourceRecord

' if we have gone past the end
' (and possibly, if there are no records)
' then the Activerecord will not be what
' we have just tried to set it to

If .DataSource.ActiveRecord intSourceRecord Then
bTerminateMerge = True
' the record exists
Else
' while we are looking at the
' correct activerecord,
' create the mail subject, body and "to"
' Just some sample code here - replace it with
' whatever you need
' NB, when specifying field names e.g. in DataFields("x")
' the names are case sensitive, so spell them correctly

strMailSubject = _
"Results for " & _
objMerge.DataSource.DataFields("k") & _
" " & objMerge.DataSource.DataFields("t")

strMailBody = _
"Dear " & objMerge.DataSource.DataFields("k") & _
vbCrLf & _
"Please find attached a Word document containing" & vbCrLf & _
"your results for..." & vbCrLf & _
vbCrLf & _
"Yours" & vbCrLf & _
"Your name"
strMailTo = objMerge.DataSource.DataFields("e")


' create the document path name
' In this case it can be te same for every recipient,
' but if you want to retain copies of the
' document, you can use info. in the data source

' this is an example - insert your
' own pathname here

strOutputDocumentName = "c:\a\results.doc"

.DataSource.FirstRecord = intSourceRecord
.DataSource.LastRecord = intSourceRecord
.Destination = wdSendToNewDocument
.Execute


' The Activedocument is always the
' output document

' Add any parameters you need to these calls
ActiveDocument.SaveAs strOutputDocumentName
ActiveDocument.Close


' Now create a mail item

If .DataSource.DataFields("e") "" Then
Set objMailItem = objOutlook.CreateItem(olMailItem)
objMailItem.Display
With objMailItem
.Attachments.Add strOutputDocumentName, olByValue, 1
.Subject = strMailSubject
.Body = strMailBody
.To = strMailTo
.Importance = olImportanceHigh
'.Save
.Send
End With
Set objMailItem = Nothing
End If
intSourceRecord = intCurrentRecord + 1
End If
Loop
End With

' Close Outlook if appropriate

If bOutlookStarted Then
objOutlook.Quit
End If

Set objOutlook = Nothing
Set objMerge = Nothing

End Sub

"pg" wrote in message
...
Useful -- but complicated ! ;-)

Are there any of the below that could help me do this automatically? Even
if
for a fee?:

1) add in?
2) 3rd party freeware/shareware

Thanks

pg


"Doug Robbins - Word MVP" wrote:

You would need to use a macro that accesses the Outlook Object Model to
do
that.

You will find a lot of what you need in the article "Mail Merge to E-mail
with Attachments" at:

http://word.mvps.org/FAQs/MailMerge/...ttachments.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"pg" wrote in message
...
Performing a mail merge in MS Word 2003 ...when the email messages get
sent
out from Outlook I want the Importance button set to high (the red
exclamation mark). There seems to be no option to set this for the
purpose
of
an email merge.

Anyone?

peter






Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail-Merge Email with Message Options NewKidontheBlock Mailmerge 3 June 13th 06 04:51 AM
mail merge to email - message body AND attachment Dan Mailmerge 1 May 26th 06 05:48 PM
Mail merge error message Word 2003 PShahin Mailmerge 1 March 10th 06 06:55 AM
How do I merge a word document to an email message and maintain a. Grizz Mailmerge 1 April 22nd 05 12:44 PM
including email message with "mail merge with attachment" Lu Mailmerge 0 February 17th 05 09:51 PM


All times are GMT +1. The time now is 12:37 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"