
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
Hi~
Thanks so much for all of your help! Unfortunately, there
might be more than one record for each date, and possibly
none at all. E.G. There might be one program on 9/1/04,
none on 9/2/04 and 9/3/04, then four programs on 9/4/04.
That's why I'm trying to figure out the If then Else
sentence. As a last resort, I can just copy and paste my
data out of Excel into my Word calendar, but since the
information will be updated frequently, I was hoping I
could figure out the merge.
If I could just ask for the If then else clarification one
more time, maybe I can get somewhere. I'm also trying to
read up on merge fields on the mvps.org website, to try to
make some sense of the merge sentence. I have been given
a deadline of September 1st to have the calendar up and
running, so I'm getting ready to cut and paste pretty soon.
Again, thanks everyone for their help. Any suggestions
are much appreciated!!
Cara :)
>-----Original Message-----
>If there is only one record for each date, you probably don't need If then
[quoted text clipped - 27 lines]
>> On Sep 1, the code would read: {IF
>> {MERGEFIELD "Begin_date"}
= "9/1/04" "{MERGEFIELD "Begin_date"}" "{MERGEFIELD "Info"}
>> "}
>> My theory was that this should only pull the records that
[quoted text clipped - 51 lines]
>
>.
Doug Robbins - 31 Aug 2004 01:49 GMT
Starting with a Catalog type mailmerge, the following could probably be
modified to do what you want: Depending on your prowess with VBA, copying
and pasting might be easier.
' Macro by Doug Robbins 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
> Hi~
>
[quoted text clipped - 131 lines]
>>
>>.
macropod - 31 Aug 2004 10:22 GMT
Hi Cara,
Depending on what you're doing, perhaps you don't need a mailmerge at all.
Have you tried copying data from the Excel sheet and pasting it into Word
using Edit|Paste Special, and choosing the 'paste link' option? Unless you
need to have different calendars for different people, this should be
sufficient, and will result in the Word document updating whenever the Excel
file is updated.
Cheers
> Hi~
>
[quoted text clipped - 131 lines]
> >
> >.