Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Diane Diane is offline
external usenet poster
 
Posts: 85
Default Programming for Outlook "Check Names"

Group,
Using OFFICE 2007

Within MSWORD, I created a vba script that completes a mail merge using
Excel as the data source. All works well, until there is an invalid email
address, such as missing "@", or missing ".net, .org, etc...

I realize now this error is actually coming from Outlook as it is sending
the email, I've turned off the option for "check names" from
Outlook/tools/options/email/advance, although this does not stop the error
from haulting the mail merge process. Since this mail merge/email process
completes during off-time hours, it is necessary that I am able to prevent
this error. Is it possible to intercept an Outlook error during a MS WORD
mail merge process.

Thanks,

  #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 Programming for Outlook "Check Names"

Are you actually automating Outlook of just the mailmerge? I think that if
you use code such as that in the article "Mail Merge to E-mail with
Attachments" at:

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

errors in email addresses will be ignored, or you could use On Error Resume
Next before the .Send command.

--
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, originally posted via msnews.microsoft.com

"Diane" wrote in message
...
Group,
Using OFFICE 2007

Within MSWORD, I created a vba script that completes a mail merge using
Excel as the data source. All works well, until there is an invalid email
address, such as missing "@", or missing ".net, .org, etc...

I realize now this error is actually coming from Outlook as it is sending
the email, I've turned off the option for "check names" from
Outlook/tools/options/email/advance, although this does not stop the error
from haulting the mail merge process. Since this mail merge/email process
completes during off-time hours, it is necessary that I am able to prevent
this error. Is it possible to intercept an Outlook error during a MS WORD
mail merge process.

Thanks,

  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Diane Diane is offline
external usenet poster
 
Posts: 85
Default Programming for Outlook "Check Names"

Doug,
In the active MS Word document, this is part of my "mail merge send":
With ActiveDocument.MailMerge
.Destination = wdSendToEmail
.SuppressBlankLines = True
.MailSubject = strsubject
.MailAddressFieldName = "Email"
With .DataSource
.FirstRecord = counterX
.LastRecord = counterY
End With
.Execute Pause:=False
End With

I've tried the "On Error Resume Next", but since I'm not in Outlook, I can't
seem to get control of the error. I've looked over the example link that you
included, I'm confused, this is not an actual mail merge?? You have an open
document and then add the Outlook object to this?? I would have to play with
your example. Basically, I have an active document that connects to an excel
datasource, merges each record with the customer, salutation, etc....then
merge to email. I have a set counter that controls the number of emails that
are sent at a time. When MS WORD merges with the "wdSendToEmail, it's at
this point that I'm assuming it leaves MS WORD and then the Outlook error
"Check Names" appear for my "dirty" email addresses.

I can scratch what I've done, and try to work from your example, unless you
have other suggestions for me.

Diane
"Doug Robbins - Word MVP" wrote:

Are you actually automating Outlook of just the mailmerge? I think that if
you use code such as that in the article "Mail Merge to E-mail with
Attachments" at:

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

errors in email addresses will be ignored, or you could use On Error Resume
Next before the .Send command.

--
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, originally posted via msnews.microsoft.com

"Diane" wrote in message
...
Group,
Using OFFICE 2007

Within MSWORD, I created a vba script that completes a mail merge using
Excel as the data source. All works well, until there is an invalid email
address, such as missing "@", or missing ".net, .org, etc...

I realize now this error is actually coming from Outlook as it is sending
the email, I've turned off the option for "check names" from
Outlook/tools/options/email/advance, although this does not stop the error
from haulting the mail merge process. Since this mail merge/email process
completes during off-time hours, it is necessary that I am able to prevent
this error. Is it possible to intercept an Outlook error during a MS WORD
mail merge process.

Thanks,

  #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 Programming for Outlook "Check Names"

Hi Diane,

You are right, that with the method that you are using, On Error Resume Next
would not be applicable.

If you execute the merge from the user interface, do you get the same "Check
Names" issue.

If you are thinking of automating Outlook, rather than the code in the
article to which I referred you, that in the ManyToOne addin that you can
down load from fellow MVP Graham Mayor's website at

http://www.gmayor.com/ManyToOne.htm

would probably be more applicable.

--
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, originally posted via msnews.microsoft.com

"Diane" wrote in message
...
Doug,
In the active MS Word document, this is part of my "mail merge send":
With ActiveDocument.MailMerge
.Destination = wdSendToEmail
.SuppressBlankLines = True
.MailSubject = strsubject
.MailAddressFieldName = "Email"
With .DataSource
.FirstRecord = counterX
.LastRecord = counterY
End With
.Execute Pause:=False
End With

I've tried the "On Error Resume Next", but since I'm not in Outlook, I
can't
seem to get control of the error. I've looked over the example link that
you
included, I'm confused, this is not an actual mail merge?? You have an
open
document and then add the Outlook object to this?? I would have to play
with
your example. Basically, I have an active document that connects to an
excel
datasource, merges each record with the customer, salutation, etc....then
merge to email. I have a set counter that controls the number of emails
that
are sent at a time. When MS WORD merges with the "wdSendToEmail, it's at
this point that I'm assuming it leaves MS WORD and then the Outlook error
"Check Names" appear for my "dirty" email addresses.

I can scratch what I've done, and try to work from your example, unless
you
have other suggestions for me.

Diane
"Doug Robbins - Word MVP" wrote:

Are you actually automating Outlook of just the mailmerge? I think that
if
you use code such as that in the article "Mail Merge to E-mail with
Attachments" at:

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

errors in email addresses will be ignored, or you could use On Error
Resume
Next before the .Send command.

--
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, originally posted via msnews.microsoft.com

"Diane" wrote in message
...
Group,
Using OFFICE 2007

Within MSWORD, I created a vba script that completes a mail merge using
Excel as the data source. All works well, until there is an invalid
email
address, such as missing "@", or missing ".net, .org, etc...

I realize now this error is actually coming from Outlook as it is
sending
the email, I've turned off the option for "check names" from
Outlook/tools/options/email/advance, although this does not stop the
error
from haulting the mail merge process. Since this mail merge/email
process
completes during off-time hours, it is necessary that I am able to
prevent
this error. Is it possible to intercept an Outlook error during a MS
WORD
mail merge process.

Thanks,

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
check articles like "a" and "the" with office 2007 spell and gramm thaar Microsoft Word Help 20 April 17th 10 12:11 PM
How to set "List Font names in their names" property in Word 2007 Test Engineer Microsoft Word Help 4 April 10th 08 11:06 AM
change spell check language "outlook express" Crazypieces Microsoft Word Help 2 October 1st 07 05:33 AM
Outlook Names List in the "TO" Box brobcpa Microsoft Word Help 1 January 8th 07 04:08 PM
Why can't "Word" find my "Outlook" address book? Bob S. Microsoft Word Help 1 May 9th 06 06:13 AM


All times are GMT +1. The time now is 06:41 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"