Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #14  
Old 12-01-2011, 07:22 AM
wowow wowow is offline Mailmerge Windows 7 32bit Mailmerge Office 2007
Novice
 
Join Date: Nov 2011
Posts: 17
wowow is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Hi wowow,

The link I posted has all you need - a link to the basic macro, plus the code (and instructions) to modify it for adding the CC stuff.
Thank macropod.

I just repalce a part of the code of mail merge with attachment by the code that uses to allows CC and BCC in mail merge as the follows:

I replaced

Code:
    With oItem
        .Subject = mysubject
        .Body = Source.Sections(j).Range.Text
        Set Datarange = Maillist.Tables(1).Cell(j, 1).Range
        Datarange.End = Datarange.End - 1
        .To = Datarange
        For i = 2 To Maillist.Tables(1).Columns.Count
            Set Datarange = Maillist.Tables(1).Cell(j, i).Range
            Datarange.End = Datarange.End - 1
            .Attachments.Add Trim(Datarange.Text), olByValue, 1
        Next i
        .Send
    End With
by

Code:
With oItem
.Subject = mysubject
.body = ActiveDocument.Content
Set Datarange = Maillist.Tables(1).Cell(Counter, 1).Range
Datarange.End = Datarange.End - 1
.To = Datarange
For i = 2 To Maillist.Tables(1).Columns.Count
Set Datarange = Maillist.Tables(1).Cell(Counter, i).Range
Datarange.End = Datarange.End - 1
.Attachments.Add Trim(Datarange.Text), olByValue, 1
Next i
.CC = "Firstemailaddress; secondemailaddress"
.BCC = "Firstemailaddress; secondemailaddress"
.Send
End With
Is it right?

Now I wonder how to use with the new code. Should I use VBA editor to embed the code in the letter that is to generate and send multiple mails or I make a separate marcro to run when I open the letter to merge emails?

Thanks.
Reply With Quote
 



Other Forums: Access Forums

All times are GMT -7. The time now is 08:03 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2026 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft