Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-01-2011, 01:53 AM
macropod's Avatar
macropod macropod is offline Mailmerge Windows 7 64bit Mailmerge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,385
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
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
Reply



Other Forums: Access Forums

All times are GMT -7. The time now is 09:11 AM.


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