Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Twisty1980 Twisty1980 is offline
external usenet poster
 
Posts: 2
Default mail merge with attachments

Hello,

I have read previous threads and have successfully implemented the email
with attachments VBA code.

However I want to extend this to include the CC operator.

My directory contains the following headings: Email | CC | Attachment1 |....

I need the code to also include the corresponding line value in the CC column.

Any help you can give would be great.
  #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 mail merge with attachments

Modify the code in the macro as follows:

With oItem
.Subject = mysubject
.Body = ActiveDocument.Content
Set Datarange = Maillist.Tables(1).Cell(Counter, 1).Range
Datarange.End = Datarange.End - 1
.To = Datarange
Set Datarange = Maillist.Tables(1).Cell(Counter, 2).Range
Datarange.End = Datarange.End - 1
.CC = Datarange
For i = 3 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
.Send
End With


--
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

"Twisty1980" wrote in message
...
Hello,

I have read previous threads and have successfully implemented the email
with attachments VBA code.

However I want to extend this to include the CC operator.

My directory contains the following headings: Email | CC | Attachment1
|....

I need the code to also include the corresponding line value in the CC
column.

Any help you can give would be great.



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Twisty1980 Twisty1980 is offline
external usenet poster
 
Posts: 2
Default mail merge with attachments

you are a genius thank you very much.

Just saved me 2 days of work

Tristan

"Doug Robbins - Word MVP" wrote:

Modify the code in the macro as follows:

With oItem
.Subject = mysubject
.Body = ActiveDocument.Content
Set Datarange = Maillist.Tables(1).Cell(Counter, 1).Range
Datarange.End = Datarange.End - 1
.To = Datarange
Set Datarange = Maillist.Tables(1).Cell(Counter, 2).Range
Datarange.End = Datarange.End - 1
.CC = Datarange
For i = 3 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
.Send
End With


--
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

"Twisty1980" wrote in message
...
Hello,

I have read previous threads and have successfully implemented the email
with attachments VBA code.

However I want to extend this to include the CC operator.

My directory contains the following headings: Email | CC | Attachment1
|....

I need the code to also include the corresponding line value in the CC
column.

Any help you can give would be great.




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 with Attachments [email protected] Microsoft Word Help 2 January 16th 07 07:22 PM
Attachments when using mail merge martin Mailmerge 1 October 27th 06 12:41 PM
Mail Merge with attachments [email protected] Microsoft Word Help 4 June 9th 06 06:29 PM
Mail Merge with attachments Graham Mayor Mailmerge 3 June 9th 06 06:29 PM
Mail Merge with Attachments Murat Gordeslioglu Mailmerge 3 May 7th 05 01:24 AM


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