Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / August 2004

Tip: Looking for answers? Try searching our database.

mailmerge in header?? catalog type

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
aprendiz - 11 Aug 2004 23:01 GMT
I have a table with employees and projects.
I want to send a letter to every employee whithe their respective projects
in one page or more if they have many projects. I did it with mailmerge
catalog type.
All works fine BUT what I need is not only the list of the projects of every
employee but to write a letter to them. It means put at the top the name of
the employee, then some text, after that the list of projects and lastly a
salutation text.
I far as I know I can't do that in catalog type.
I tried putting the initial text in the header and the salutation in the
footer. That works fine BUT I need to be able to put the employee name in the
header and it is not working.
I hope I am clear if not let me know please.
Thanks in advance.
Aprendiz
Doug Robbins - 12 Aug 2004 00:28 GMT
This will need a bit more development to achieve exactly what you want, but
it will take the result of a catalog type mailmerge (with in your case the
employee as the first mergefield) created with the mergefields in the cells
of a single row table and create separate tables for each employee with the
employees name in the first row of the table and their projects in the rest
of the rows of the table.

' Macro to create multiple items per condition in separate tables from a
directory type mailmerge

Dim source As Document, target As Document, scat As Range, tcat As Range

Dim data As Range, stab As Table, ttab As Table

Dim i As Long, j As Long, k As Long, n As Long

Set source = ActiveDocument

Set target = Documents.Add

Set stab = source.Tables(1)

k = stab.Columns.Count

Set ttab = target.Tables.Add(Range:=Selection.Range, numrows:=1,
numcolumns:=k - 1)

Set scat = stab.Cell(1, 1).Range

scat.End = scat.End - 1

ttab.Cell(1, 1).Range = scat

j = ttab.Rows.Count

For i = 1 To stab.Rows.Count

   Set tcat = ttab.Cell(j, 1).Range

   tcat.End = tcat.End - 1

   Set scat = stab.Cell(i, 1).Range

   scat.End = scat.End - 1

   If scat <> tcat Then

       ttab.Rows.Add

       j = ttab.Rows.Count

       ttab.Cell(j, 1).Range = scat

       ttab.Cell(j, 1).Range.Paragraphs(1).PageBreakBefore = True

       ttab.Rows.Add

       ttab.Cell(j + 1, 1).Range.Paragraphs(1).PageBreakBefore = False

       For n = 2 To k

           Set data = stab.Cell(i, n).Range

           data.End = data.End - 1

           ttab.Cell(ttab.Rows.Count, n - 1).Range = data

       Next n

   Else

       ttab.Rows.Add

       For n = 2 To k

           Set data = stab.Cell(i, n).Range

           data.End = data.End - 1

           ttab.Cell(ttab.Rows.Count, n - 1).Range = data

       Next n

   End If

Next i

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

>I have a table with employees and projects.
> I want to send a letter to every employee whithe their respective projects
[quoted text clipped - 14 lines]
> Thanks in advance.
> Aprendiz
aprendiz - 12 Aug 2004 01:01 GMT
Thanks Doug for your answer!
I am new at this and I will need more help if it is possible.
I've created the directory in a catalog type mailmerge document in this way:

{IF {mergeseq}="1" "{mergefield Employee}" " "}
{SET Employee1 {mergefield Employee}}
{IF {Employee2} <> {Employee1}
.....................Page Break..............
"{mergefield Employee}"
{mergefield Project}" "{mergefield Project}" }

When I mailmerge to a new document (called it NEW.doc) I can see my
directory/catalog with an employee and projects in one page.
When I have to use the macro?? in the mailmerge catalog as a macro? or once
I have the NEW document with the results of my catalog mailmerge.
Sorry, it may be a very silly question but I really don't understand.
Aprendriz

> This will need a bit more development to achieve exactly what you want, but
> it will take the result of a catalog type mailmerge (with in your case the
[quoted text clipped - 101 lines]
> > Thanks in advance.
> > Aprendiz
Doug Robbins - 13 Aug 2004 01:54 GMT
You need to re-read the first paragraph of my response and set up the
mailmerge main document in the way described which is completely different
from that which you have used.  The macro will only work if the document
created by executing the merge is of the right format.

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

> Thanks Doug for your answer!
> I am new at this and I will need more help if it is possible.
[quoted text clipped - 131 lines]
>> > Thanks in advance.
>> > Aprendiz
aprendiz - 22 Aug 2004 18:17 GMT
Thanks a lot Doug!
It took me a while but at the end I understood. :-)
It did exactly what I wanted.

Aprendiz

> You need to re-read the first paragraph of my response and set up the
> mailmerge main document in the way described which is completely different
[quoted text clipped - 136 lines]
> >> > Thanks in advance.
> >> > Aprendiz

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.