Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 04-27-2009, 03:06 PM
kjdemeyer kjdemeyer is offline
Registered User
 
Join Date: 27 Apr 2009
Location: Wausau, Wisconsin
MS Office Version:Excel 2003
Posts: 1
kjdemeyer is becoming part of the community
How to send the same form to different email addresses using macros?

Please Register to Remove these Ads

I have a Word form that gets send to a specific email address when it is saved, but now I want to send the same form to different email addresses based on a selection in the form. Form example if they select "yes" the form would go to one email address, but if they choose "no" it would get sent to a different email address. How do I change the macro language to accomplish this. Here is a sample of the current language:


Code:
'create email message using the account number as the subject and delivers the
'document to all recipients
    ActiveDocument.HasRoutingSlip = True
    With ActiveDocument.RoutingSlip
        '.Subject = ActiveDocument.FormFields("txtAcctNum").Result & " - " & ActiveDocument.FormFields("txtInsdNm").Result
        .Subject = "Cancellation Request for " & ActiveDocument.FormFields("txtInsdNm").Result
        .Message = "Please see attached Cancellation Request."
        .AddRecipient Recipient:="LewistonMMProduction@LibertyMutual.com"
        .Delivery = wdAllAtOnce
        .ReturnWhenDone = False
        .TrackStatus = False
    End With

Last edited by VBA Noob; 04-27-2009 at 03:40 PM. Reason: Added code tags as per forum rules
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump