Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Merging multiple images to a page
Hi.
I have set up mail merge from Access to Word many times. Now I want to mail merge images and have many (different) images on a page - a bit like labels. In fact I've used a label Wizard in Access to produce a report containing three rows of five images on a landscape page with the name of the image below each one. Each image and name is a separate record in Access. What I really want is to produce a two page mail merged document. The first page is a letter with the usual type of merge fields inserted. The second page would contain, say, five rows of three images with appropriate name underneath. By the way, I know how to merge images and I can concatenate the image and name records in Access so that I can produce a letter to one address with multiple associated images. The way this works at present is that images and names appear one below the other, in a column. I just want to be able to spread them out, like a labels layout. Has anyone any idea how I could proceed? Thanks, JohnB |
#2
|
|||
|
|||
Is the data (your so-called "usual type of merge fields") AND the filename
info for each image all in the one record? That is, you have a field for each image that goes with an individual record. If that is the case, just set up your mail merge document with the first page as you want it, and on page 2, insert a table with the desired number of rows and columns and insert an image mergefield in each cell of that table. -- 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 "JohnB" wrote in message news Hi. I have set up mail merge from Access to Word many times. Now I want to merge images and have many (different) images on a page - a bit like labels. In fact I've used a label Wizard in Access to produce a report containing three rows of five images on a landscape page with the name of the image below each one. Each image and name is a separate record in Access. What I really want is to produce a two page mail merged document. The first page is a letter with the usual type of merge fields inserted. The second page would contain, say, five rows of three images with appropriate name underneath. By the way, I know how to merge images and I can concatenate the image and name records in Access so that I can produce a letter to one address with multiple associated images. The way this works at present is that images and names appear one below the other, in a column. I just want to be able to spread them out, like a labels layout. Has anyone any idea how I could proceed? Thanks, JohnB |
#3
|
|||
|
|||
Thanks Doug.
Perhaps I'd better expand. The data being merged is based on records in a "one to many" relationship. These records are brought together in a query that creates a number of records, each containing various fields from the "one" side and concatenated records from the "many" side. So each record presented to the merge would have AddressLine1, AddressLine2, Town, County, PostCode ( the "one side") then a Name field (from the "many" side) containing, say, three names each with carriage return and line feed characters. This produces a merge page containing an Address at the top and then a column of the three names, one under the other, in the body text. The field containing the image path (ImagePathAndFile)is in the "many" side records, along with the Name field. I'm guessing that I will also need to concatenate the ImagePathAndFile field, to maintain the same "one to many" relationship i.e. many images to one address. Does this help? Anyway, I will have a look into using a Table, but I'm not too sure if it will work. How would the table handle three image paths concatenated into one field? How would I separate them in the field? As I say, the Name concatenate uses carriage return and line feed characters to force the Names into a column in the merged document but surely that will not work with a Table. Thanks again for the help, JohnB "Doug Robbins" wrote: Is the data (your so-called "usual type of merge fields") AND the filename info for each image all in the one record? That is, you have a field for each image that goes with an individual record. If that is the case, just set up your mail merge document with the first page as you want it, and on page 2, insert a table with the desired number of rows and columns and insert an image mergefield in each cell of that table. -- 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 "JohnB" wrote in message news Hi. I have set up mail merge from Access to Word many times. Now I want to merge images and have many (different) images on a page - a bit like labels. In fact I've used a label Wizard in Access to produce a report containing three rows of five images on a landscape page with the name of the image below each one. Each image and name is a separate record in Access. What I really want is to produce a two page mail merged document. The first page is a letter with the usual type of merge fields inserted. The second page would contain, say, five rows of three images with appropriate name underneath. By the way, I know how to merge images and I can concatenate the image and name records in Access so that I can produce a letter to one address with multiple associated images. The way this works at present is that images and names appear one below the other, in a column. I just want to be able to spread them out, like a labels layout. Has anyone any idea how I could proceed? Thanks, JohnB |
#4
|
|||
|
|||
I had a suspicion that was what you were working with hence the
qualification on my response. Word does not really have the ability to perform a "multiple items per condition (=key field)" mailmerge. See the "Multiple items per condition" item under the "Special merges" section of fellow MVP Cindy Meister's website at http://homepage.swissonline.ch/cindy...r/MergFram.htm Or, if you create a Catalog (on in Word XP and later, it's called Directory) type mailmerge main document with the mergefields in the cells of a one row table in the mailmerge main document with the keyfield in the first cell in the row and then execute that merge to a new document and then run the following macro, it will create separate tables with the records for each key field in them. With a bit of further development, you may be able to get it to do what you want. ' 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 -- 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 "JohnB" wrote in message ... Thanks Doug. Perhaps I'd better expand. The data being merged is based on records in a "one to many" relationship. These records are brought together in a query that creates a number of records, each containing various fields from the "one" side and concatenated records from the "many" side. So each record presented to the merge would have AddressLine1, AddressLine2, Town, County, PostCode ( the "one side") then a Name field (from the "many" side) containing, say, three names each with carriage return and line feed characters. This produces a merge page containing an Address at the top and then a column of the three names, one under the other, in the body text. The field containing the image path (ImagePathAndFile)is in the "many" side records, along with the Name field. I'm guessing that I will also need to concatenate the ImagePathAndFile field, to maintain the same "one to many" relationship i.e. many images to one address. Does this help? Anyway, I will have a look into using a Table, but I'm not too sure if it will work. How would the table handle three image paths concatenated into one field? How would I separate them in the field? As I say, the Name concatenate uses carriage return and line feed characters to force the Names into a column in the merged document but surely that will not work with a Table. Thanks again for the help, JohnB "Doug Robbins" wrote: Is the data (your so-called "usual type of merge fields") AND the filename info for each image all in the one record? That is, you have a field for each image that goes with an individual record. If that is the case, just set up your mail merge document with the first page as you want it, and on page 2, insert a table with the desired number of rows and columns and insert an image mergefield in each cell of that table. -- 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 "JohnB" wrote in message news Hi. I have set up mail merge from Access to Word many times. Now I want to merge images and have many (different) images on a page - a bit like labels. In fact I've used a label Wizard in Access to produce a report containing three rows of five images on a landscape page with the name of the image below each one. Each image and name is a separate record in Access. What I really want is to produce a two page mail merged document. The first page is a letter with the usual type of merge fields inserted. The second page would contain, say, five rows of three images with appropriate name underneath. By the way, I know how to merge images and I can concatenate the image and name records in Access so that I can produce a letter to one address with multiple associated images. The way this works at present is that images and names appear one below the other, in a column. I just want to be able to spread them out, like a labels layout. Has anyone any idea how I could proceed? Thanks, JohnB |
#5
|
|||
|
|||
Thanks Doug.
Hmmm. Lots to take in there. I'll have to spend some time looking into this. If it looks too daunting, perhaps I'll just rely on the mail merge to produce the first pages, with merge fields and text and use the access report to produce the second pages, containing the images. Thanks again, JohnB "Doug Robbins" wrote: I had a suspicion that was what you were working with hence the qualification on my response. Word does not really have the ability to perform a "multiple items per condition (=key field)" mailmerge. See the "Multiple items per condition" item under the "Special merges" section of fellow MVP Cindy Meister's website at http://homepage.swissonline.ch/cindy...r/MergFram.htm Or, if you create a Catalog (on in Word XP and later, it's called Directory) type mailmerge main document with the mergefields in the cells of a one row table in the mailmerge main document with the keyfield in the first cell in the row and then execute that merge to a new document and then run the following macro, it will create separate tables with the records for each key field in them. With a bit of further development, you may be able to get it to do what you want. ' 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 -- 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 "JohnB" wrote in message ... Thanks Doug. Perhaps I'd better expand. The data being merged is based on records in a "one to many" relationship. These records are brought together in a query that creates a number of records, each containing various fields from the "one" side and concatenated records from the "many" side. So each record presented to the merge would have AddressLine1, AddressLine2, Town, County, PostCode ( the "one side") then a Name field (from the "many" side) containing, say, three names each with carriage return and line feed characters. This produces a merge page containing an Address at the top and then a column of the three names, one under the other, in the body text. The field containing the image path (ImagePathAndFile)is in the "many" side records, along with the Name field. I'm guessing that I will also need to concatenate the ImagePathAndFile field, to maintain the same "one to many" relationship i.e. many images to one address. Does this help? Anyway, I will have a look into using a Table, but I'm not too sure if it will work. How would the table handle three image paths concatenated into one field? How would I separate them in the field? As I say, the Name concatenate uses carriage return and line feed characters to force the Names into a column in the merged document but surely that will not work with a Table. Thanks again for the help, JohnB "Doug Robbins" wrote: Is the data (your so-called "usual type of merge fields") AND the filename info for each image all in the one record? That is, you have a field for each image that goes with an individual record. If that is the case, just set up your mail merge document with the first page as you want it, and on page 2, insert a table with the desired number of rows and columns and insert an image mergefield in each cell of that table. -- 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 "JohnB" wrote in message news Hi. I have set up mail merge from Access to Word many times. Now I want to merge images and have many (different) images on a page - a bit like labels. In fact I've used a label Wizard in Access to produce a report containing three rows of five images on a landscape page with the name of the image below each one. Each image and name is a separate record in Access. What I really want is to produce a two page mail merged document. The first page is a letter with the usual type of merge fields inserted. The second page would contain, say, five rows of three images with appropriate name underneath. By the way, I know how to merge images and I can concatenate the image and name records in Access so that I can produce a letter to one address with multiple associated images. The way this works at present is that images and names appear one below the other, in a column. I just want to be able to spread them out, like a labels layout. Has anyone any idea how I could proceed? Thanks, JohnB |
#6
|
|||
|
|||
Why not do it all in Access? That's what I would do.
-- 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 "JohnB" wrote in message ... Thanks Doug. Hmmm. Lots to take in there. I'll have to spend some time looking into this. If it looks too daunting, perhaps I'll just rely on the mail merge to produce the first pages, with merge fields and text and use the access report to produce the second pages, containing the images. Thanks again, JohnB "Doug Robbins" wrote: I had a suspicion that was what you were working with hence the qualification on my response. Word does not really have the ability to perform a "multiple items per condition (=key field)" mailmerge. See the "Multiple items per condition" item under the "Special merges" section of fellow MVP Cindy Meister's website at http://homepage.swissonline.ch/cindy...r/MergFram.htm Or, if you create a Catalog (on in Word XP and later, it's called Directory) type mailmerge main document with the mergefields in the cells of a one row table in the mailmerge main document with the keyfield in the first cell in the row and then execute that merge to a new document and then run the following macro, it will create separate tables with the records for each key field in them. With a bit of further development, you may be able to get it to do what you want. ' 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 -- 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 "JohnB" wrote in message ... Thanks Doug. Perhaps I'd better expand. The data being merged is based on records in a "one to many" relationship. These records are brought together in a query that creates a number of records, each containing various fields from the "one" side and concatenated records from the "many" side. So each record presented to the merge would have AddressLine1, AddressLine2, Town, County, PostCode ( the "one side") then a Name field (from the "many" side) containing, say, three names each with carriage return and line feed characters. This produces a merge page containing an Address at the top and then a column of the three names, one under the other, in the body text. The field containing the image path (ImagePathAndFile)is in the "many" side records, along with the Name field. I'm guessing that I will also need to concatenate the ImagePathAndFile field, to maintain the same "one to many" relationship i.e. many images to one address. Does this help? Anyway, I will have a look into using a Table, but I'm not too sure if it will work. How would the table handle three image paths concatenated into one field? How would I separate them in the field? As I say, the Name concatenate uses carriage return and line feed characters to force the Names into a column in the merged document but surely that will not work with a Table. Thanks again for the help, JohnB "Doug Robbins" wrote: Is the data (your so-called "usual type of merge fields") AND the filename info for each image all in the one record? That is, you have a field for each image that goes with an individual record. If that is the case, just set up your mail merge document with the first page as you want it, and on page 2, insert a table with the desired number of rows and columns and insert an image mergefield in each cell of that table. -- 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 "JohnB" wrote in message news Hi. I have set up mail merge from Access to Word many times. Now I want to merge images and have many (different) images on a page - a bit like labels. In fact I've used a label Wizard in Access to produce a report containing three rows of five images on a landscape page with the name of the image below each one. Each image and name is a separate record in Access. What I really want is to produce a two page mail merged document. The first page is a letter with the usual type of merge fields inserted. The second page would contain, say, five rows of three images with appropriate name underneath. By the way, I know how to merge images and I can concatenate the image and name records in Access so that I can produce a letter to one address with multiple associated images. The way this works at present is that images and names appear one below the other, in a column. I just want to be able to spread them out, like a labels layout. Has anyone any idea how I could proceed? Thanks, JohnB |
#7
|
|||
|
|||
Hi Doug.
Do it all in Access? Could you expand on that? I'm using Mail Merge from Access to produce letters, where the text needs to be changed over time. It would be usefull to be able to include pictures in the merge but having a separate Access report to produce the pictures would be acceptable, if a little more awkward to collate. Thanks, JohnB "Doug Robbins" wrote: Why not do it all in Access? That's what I would do. -- 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 "JohnB" wrote in message ... Thanks Doug. Hmmm. Lots to take in there. I'll have to spend some time looking into this. If it looks too daunting, perhaps I'll just rely on the mail merge to produce the first pages, with merge fields and text and use the access report to produce the second pages, containing the images. Thanks again, JohnB "Doug Robbins" wrote: I had a suspicion that was what you were working with hence the qualification on my response. Word does not really have the ability to perform a "multiple items per condition (=key field)" mailmerge. See the "Multiple items per condition" item under the "Special merges" section of fellow MVP Cindy Meister's website at http://homepage.swissonline.ch/cindy...r/MergFram.htm Or, if you create a Catalog (on in Word XP and later, it's called Directory) type mailmerge main document with the mergefields in the cells of a one row table in the mailmerge main document with the keyfield in the first cell in the row and then execute that merge to a new document and then run the following macro, it will create separate tables with the records for each key field in them. With a bit of further development, you may be able to get it to do what you want. ' 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 -- 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 "JohnB" wrote in message ... Thanks Doug. Perhaps I'd better expand. The data being merged is based on records in a "one to many" relationship. These records are brought together in a query that creates a number of records, each containing various fields from the "one" side and concatenated records from the "many" side. So each record presented to the merge would have AddressLine1, AddressLine2, Town, County, PostCode ( the "one side") then a Name field (from the "many" side) containing, say, three names each with carriage return and line feed characters. This produces a merge page containing an Address at the top and then a column of the three names, one under the other, in the body text. The field containing the image path (ImagePathAndFile)is in the "many" side records, along with the Name field. I'm guessing that I will also need to concatenate the ImagePathAndFile field, to maintain the same "one to many" relationship i.e. many images to one address. Does this help? Anyway, I will have a look into using a Table, but I'm not too sure if it will work. How would the table handle three image paths concatenated into one field? How would I separate them in the field? As I say, the Name concatenate uses carriage return and line feed characters to force the Names into a column in the merged document but surely that will not work with a Table. Thanks again for the help, JohnB "Doug Robbins" wrote: Is the data (your so-called "usual type of merge fields") AND the filename info for each image all in the one record? That is, you have a field for each image that goes with an individual record. If that is the case, just set up your mail merge document with the first page as you want it, and on page 2, insert a table with the desired number of rows and columns and insert an image mergefield in each cell of that table. -- 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 "JohnB" wrote in message news Hi. I have set up mail merge from Access to Word many times. Now I want to merge images and have many (different) images on a page - a bit like labels. In fact I've used a label Wizard in Access to produce a report containing three rows of five images on a landscape page with the name of the image below each one. Each image and name is a separate record in Access. What I really want is to produce a two page mail merged document. The first page is a letter with the usual type of merge fields inserted. The second page would contain, say, five rows of three images with appropriate name underneath. By the way, I know how to merge images and I can concatenate the image and name records in Access so that I can produce a letter to one address with multiple associated images. The way this works at present is that images and names appear one below the other, in a column. I just want to be able to spread them out, like a labels layout. Has anyone any idea how I could proceed? Thanks, JohnB |
#8
|
|||
|
|||
The whole thing can be done as a report in Access.
-- 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 "JohnB" wrote in message ... Hi Doug. Do it all in Access? Could you expand on that? I'm using Mail Merge from Access to produce letters, where the text needs to be changed over time. It would be usefull to be able to include pictures in the merge but having a separate Access report to produce the pictures would be acceptable, if a little more awkward to collate. Thanks, JohnB "Doug Robbins" wrote: Why not do it all in Access? That's what I would do. -- 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 "JohnB" wrote in message ... Thanks Doug. Hmmm. Lots to take in there. I'll have to spend some time looking into this. If it looks too daunting, perhaps I'll just rely on the mail merge to produce the first pages, with merge fields and text and use the access report to produce the second pages, containing the images. Thanks again, JohnB "Doug Robbins" wrote: I had a suspicion that was what you were working with hence the qualification on my response. Word does not really have the ability to perform a "multiple items per condition (=key field)" mailmerge. See the "Multiple items per condition" item under the "Special merges" section of fellow MVP Cindy Meister's website at http://homepage.swissonline.ch/cindy...r/MergFram.htm Or, if you create a Catalog (on in Word XP and later, it's called Directory) type mailmerge main document with the mergefields in the cells of a one row table in the mailmerge main document with the keyfield in the first cell in the row and then execute that merge to a new document and then run the following macro, it will create separate tables with the records for each key field in them. With a bit of further development, you may be able to get it to do what you want. ' 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 -- 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 "JohnB" wrote in message ... Thanks Doug. Perhaps I'd better expand. The data being merged is based on records in a "one to many" relationship. These records are brought together in a query that creates a number of records, each containing various fields from the "one" side and concatenated records from the "many" side. So each record presented to the merge would have AddressLine1, AddressLine2, Town, County, PostCode ( the "one side") then a Name field (from the "many" side) containing, say, three names each with carriage return and line feed characters. This produces a merge page containing an Address at the top and then a column of the three names, one under the other, in the body text. The field containing the image path (ImagePathAndFile)is in the "many" side records, along with the Name field. I'm guessing that I will also need to concatenate the ImagePathAndFile field, to maintain the same "one to many" relationship i.e. many images to one address. Does this help? Anyway, I will have a look into using a Table, but I'm not too sure if it will work. How would the table handle three image paths concatenated into one field? How would I separate them in the field? As I say, the Name concatenate uses carriage return and line feed characters to force the Names into a column in the merged document but surely that will not work with a Table. Thanks again for the help, JohnB "Doug Robbins" wrote: Is the data (your so-called "usual type of merge fields") AND the filename info for each image all in the one record? That is, you have a field for each image that goes with an individual record. If that is the case, just set up your mail merge document with the first page as you want it, and on page 2, insert a table with the desired number of rows and columns and insert an image mergefield in each cell of that table. -- 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 "JohnB" wrote in message news Hi. I have set up mail merge from Access to Word many times. Now I want to merge images and have many (different) images on a page - a bit like labels. In fact I've used a label Wizard in Access to produce a report containing three rows of five images on a landscape page with the name of the image below each one. Each image and name is a separate record in Access. What I really want is to produce a two page mail merged document. The first page is a letter with the usual type of merge fields inserted. The second page would contain, say, five rows of three images with appropriate name underneath. By the way, I know how to merge images and I can concatenate the image and name records in Access so that I can produce a letter to one address with multiple associated images. The way this works at present is that images and names appear one below the other, in a column. I just want to be able to spread them out, like a labels layout. Has anyone any idea how I could proceed? Thanks, JohnB |
#9
|
|||
|
|||
Hi Doug. How would Users modify the text parts, without having to go into
"design"? JohnB "Doug Robbins" wrote: The whole thing can be done as a report in Access. -- 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 "JohnB" wrote in message ... Hi Doug. Do it all in Access? Could you expand on that? I'm using Mail Merge from Access to produce letters, where the text needs to be changed over time. It would be usefull to be able to include pictures in the merge but having a separate Access report to produce the pictures would be acceptable, if a little more awkward to collate. Thanks, JohnB "Doug Robbins" wrote: Why not do it all in Access? That's what I would do. -- 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 "JohnB" wrote in message ... Thanks Doug. Hmmm. Lots to take in there. I'll have to spend some time looking into this. If it looks too daunting, perhaps I'll just rely on the mail merge to produce the first pages, with merge fields and text and use the access report to produce the second pages, containing the images. Thanks again, JohnB "Doug Robbins" wrote: I had a suspicion that was what you were working with hence the qualification on my response. Word does not really have the ability to perform a "multiple items per condition (=key field)" mailmerge. See the "Multiple items per condition" item under the "Special merges" section of fellow MVP Cindy Meister's website at http://homepage.swissonline.ch/cindy...r/MergFram.htm Or, if you create a Catalog (on in Word XP and later, it's called Directory) type mailmerge main document with the mergefields in the cells of a one row table in the mailmerge main document with the keyfield in the first cell in the row and then execute that merge to a new document and then run the following macro, it will create separate tables with the records for each key field in them. With a bit of further development, you may be able to get it to do what you want. ' 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 -- 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 "JohnB" wrote in message ... Thanks Doug. Perhaps I'd better expand. The data being merged is based on records in a "one to many" relationship. These records are brought together in a query that creates a number of records, each containing various fields from the "one" side and concatenated records from the "many" side. So each record presented to the merge would have AddressLine1, AddressLine2, Town, County, PostCode ( the "one side") then a Name field (from the "many" side) containing, say, three names each with carriage return and line feed characters. This produces a merge page containing an Address at the top and then a column of the three names, one under the other, in the body text. The field containing the image path (ImagePathAndFile)is in the "many" side records, along with the Name field. I'm guessing that I will also need to concatenate the ImagePathAndFile field, to maintain the same "one to many" relationship i.e. many images to one address. Does this help? Anyway, I will have a look into using a Table, but I'm not too sure if it will work. How would the table handle three image paths concatenated into one field? How would I separate them in the field? As I say, the Name concatenate uses carriage return and line feed characters to force the Names into a column in the merged document but surely that will not work with a Table. Thanks again for the help, JohnB "Doug Robbins" wrote: Is the data (your so-called "usual type of merge fields") AND the filename info for each image all in the one record? That is, you have a field for each image that goes with an individual record. If that is the case, just set up your mail merge document with the first page as you want it, and on page 2, insert a table with the desired number of rows and columns and insert an image mergefield in each cell of that table. -- 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 "JohnB" wrote in message news Hi. I have set up mail merge from Access to Word many times. Now I want to merge images and have many (different) images on a page - a bit like labels. In fact I've used a label Wizard in Access to produce a report containing three rows of five images on a landscape page with the name of the image below each one. Each image and name is a separate record in Access. What I really want is to produce a two page mail merged document. The first page is a letter with the usual type of merge fields inserted. The second page would contain, say, five rows of three images with appropriate name underneath. By the way, I know how to merge images and I can concatenate the image and name records in Access so that I can produce a letter to one address with multiple associated images. The way this works at present is that images and names appear one below the other, in a column. I just want to be able to spread them out, like a labels layout. Has anyone any idea how I could proceed? Thanks, JohnB |
#10
|
|||
|
|||
I guess it's a case of the lesser of two evils.
-- 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 "JohnB" wrote in message ... Hi Doug. How would Users modify the text parts, without having to go into "design"? JohnB "Doug Robbins" wrote: The whole thing can be done as a report in Access. -- 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 "JohnB" wrote in message ... Hi Doug. Do it all in Access? Could you expand on that? I'm using Mail Merge from Access to produce letters, where the text needs to be changed over time. It would be usefull to be able to include pictures in the merge but having a separate Access report to produce the pictures would be acceptable, if a little more awkward to collate. Thanks, JohnB "Doug Robbins" wrote: Why not do it all in Access? That's what I would do. -- 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 "JohnB" wrote in message ... Thanks Doug. Hmmm. Lots to take in there. I'll have to spend some time looking into this. If it looks too daunting, perhaps I'll just rely on the mail merge to produce the first pages, with merge fields and text and use the access report to produce the second pages, containing the images. Thanks again, JohnB "Doug Robbins" wrote: I had a suspicion that was what you were working with hence the qualification on my response. Word does not really have the ability to perform a "multiple items per condition (=key field)" mailmerge. See the "Multiple items per condition" item under the "Special merges" section of fellow MVP Cindy Meister's website at http://homepage.swissonline.ch/cindy...r/MergFram.htm Or, if you create a Catalog (on in Word XP and later, it's called Directory) type mailmerge main document with the mergefields in the cells of a one row table in the mailmerge main document with the keyfield in the first cell in the row and then execute that merge to a new document and then run the following macro, it will create separate tables with the records for each key field in them. With a bit of further development, you may be able to get it to do what you want. ' 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 -- 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 "JohnB" wrote in message ... Thanks Doug. Perhaps I'd better expand. The data being merged is based on records in a "one to many" relationship. These records are brought together in a query that creates a number of records, each containing various fields from the "one" side and concatenated records from the "many" side. So each record presented to the merge would have AddressLine1, AddressLine2, Town, County, PostCode ( the "one side") then a Name field (from the "many" side) containing, say, three names each with carriage return and line feed characters. This produces a merge page containing an Address at the top and then a column of the three names, one under the other, in the body text. The field containing the image path (ImagePathAndFile)is in the "many" side records, along with the Name field. I'm guessing that I will also need to concatenate the ImagePathAndFile field, to maintain the same "one to many" relationship i.e. many images to one address. Does this help? Anyway, I will have a look into using a Table, but I'm not too sure if it will work. How would the table handle three image paths concatenated into one field? How would I separate them in the field? As I say, the Name concatenate uses carriage return and line feed characters to force the Names into a column in the merged document but surely that will not work with a Table. Thanks again for the help, JohnB "Doug Robbins" wrote: Is the data (your so-called "usual type of merge fields") AND the filename info for each image all in the one record? That is, you have a field for each image that goes with an individual record. If that is the case, just set up your mail merge document with the first page as you want it, and on page 2, insert a table with the desired number of rows and columns and insert an image mergefield in each cell of that table. -- 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 "JohnB" wrote in message news Hi. I have set up mail merge from Access to Word many times. Now I want to merge images and have many (different) images on a page - a bit like labels. In fact I've used a label Wizard in Access to produce a report containing three rows of five images on a landscape page with the name of the image below each one. Each image and name is a separate record in Access. What I really want is to produce a two page mail merged document. The first page is a letter with the usual type of merge fields inserted. The second page would contain, say, five rows of three images with appropriate name underneath. By the way, I know how to merge images and I can concatenate the image and name records in Access so that I can produce a letter to one address with multiple associated images. The way this works at present is that images and names appear one below the other, in a column. I just want to be able to spread them out, like a labels layout. Has anyone any idea how I could proceed? Thanks, JohnB |
#11
|
|||
|
|||
Yes, I suppost so. Signing off now. Thanks for your time Doug
"Doug Robbins" wrote: I guess it's a case of the lesser of two evils. -- 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 "JohnB" wrote in message ... Hi Doug. How would Users modify the text parts, without having to go into "design"? JohnB "Doug Robbins" wrote: The whole thing can be done as a report in Access. -- 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 "JohnB" wrote in message ... Hi Doug. Do it all in Access? Could you expand on that? I'm using Mail Merge from Access to produce letters, where the text needs to be changed over time. It would be usefull to be able to include pictures in the merge but having a separate Access report to produce the pictures would be acceptable, if a little more awkward to collate. Thanks, JohnB "Doug Robbins" wrote: Why not do it all in Access? That's what I would do. -- 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 "JohnB" wrote in message ... Thanks Doug. Hmmm. Lots to take in there. I'll have to spend some time looking into this. If it looks too daunting, perhaps I'll just rely on the mail merge to produce the first pages, with merge fields and text and use the access report to produce the second pages, containing the images. Thanks again, JohnB "Doug Robbins" wrote: I had a suspicion that was what you were working with hence the qualification on my response. Word does not really have the ability to perform a "multiple items per condition (=key field)" mailmerge. See the "Multiple items per condition" item under the "Special merges" section of fellow MVP Cindy Meister's website at http://homepage.swissonline.ch/cindy...r/MergFram.htm Or, if you create a Catalog (on in Word XP and later, it's called Directory) type mailmerge main document with the mergefields in the cells of a one row table in the mailmerge main document with the keyfield in the first cell in the row and then execute that merge to a new document and then run the following macro, it will create separate tables with the records for each key field in them. With a bit of further development, you may be able to get it to do what you want. ' 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 -- 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 "JohnB" wrote in message ... Thanks Doug. Perhaps I'd better expand. The data being merged is based on records in a "one to many" relationship. These records are brought together in a query that creates a number of records, each containing various fields from the "one" side and concatenated records from the "many" side. So each record presented to the merge would have AddressLine1, AddressLine2, Town, County, PostCode ( the "one side") then a Name field (from the "many" side) containing, say, three names each with carriage return and line feed characters. This produces a merge page containing an Address at the top and then a column of the three names, one under the other, in the body text. The field containing the image path (ImagePathAndFile)is in the "many" side records, along with the Name field. I'm guessing that I will also need to concatenate the ImagePathAndFile field, to maintain the same "one to many" relationship i.e. many images to one address. Does this help? Anyway, I will have a look into using a Table, but I'm not too sure if it will work. How would the table handle three image paths concatenated into one field? How would I separate them in the field? As I say, the Name concatenate uses carriage return and line feed characters to force the Names into a column in the merged document but surely that will not work with a Table. Thanks again for the help, JohnB "Doug Robbins" wrote: Is the data (your so-called "usual type of merge fields") AND the filename info for each image all in the one record? That is, you have a field for each image that goes with an individual record. If that is the case, just set up your mail merge document with the first page as you want it, and on page 2, insert a table with the desired number of rows and columns and insert an image mergefield in each cell of that table. -- 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 "JohnB" wrote in message news Hi. I have set up mail merge from Access to Word many times. Now I want to merge images and have many (different) images on a page - a bit like labels. In fact I've used a label Wizard in Access to produce a report containing three rows of five images on a landscape page with the name of the image below each one. Each image and name is a separate record in Access. What I really want is to produce a two page mail merged document. The first page is a letter with the usual type of merge fields inserted. The second page would contain, say, five rows of three images with appropriate name underneath. By the way, I know how to merge images and I can concatenate the image and name records in Access so that I can produce a letter to one address with multiple associated images. The way this works at present is that images and names appear one below the other, in a column. I just want to be able |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
multiple page document | Page Layout | |||
Page number difficulties | Microsoft Word Help | |||
Page Numbering in Multiple Section Documents | Microsoft Word Help | |||
Problems merging many records on a single page | Mailmerge | |||
FIrst page footers | Microsoft Word Help |