Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge Several Names on One Doc Page, Then Different Names on Next
I want to print team rosters in an existing MS Word document, each team
appearing on its own copy of the document. The number of team members varies from team to team. Access contains several hundred names in the Employees table. The employees are members of 57 teams, each employee being on only one team. A second table contains the names and descriptions of the teams. The query in Access combines both tables in one record for each employee. To clarify, I mean that each record contains one employee name, the name of the team, and the team information. (I agree that successive records contain duplicate information, but I have not normalized the employee table, so it remains simple for the users.) If I could trap the team name in a temporary user-defined variable, the solution would be elegantly simple: Next RecordIF team name is same THEN MemberName I have not found such a user variable in MS Word documentation. I am hoping that I do not have to resort to macros. I am comfortable with VBA for Access, but have not done anything like that with MS Word. To complicate things a bit, I would like to add this document to a master document that contains two more sub-documents that need the same treatment, printing employee names by team. The master document would print a bundle of documents for each team. If you are curious, the documents in the bundle represent milestones in a large project that requires tracking. Right now, the team leaders manually fill in each document. I am trying to simplify their life and improve accuracy. Thank you for your valuable time. -- Write well, and do good works. |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge Several Names on One Doc Page, Then Different Names on Next
See the "Group Multiple items for a single condition" item on fellow MVP
Cindy Meister's website at http://homepage.swissonline.ch/cindy...faq1.htm#DBPic Or take a look at the following Knowledge Base Article http://support.microsoft.com/default...b;en-us;211303 Or, maybe the following will show you how to do what you are after: http://cornell.veplan.net/article.aspx?&a=3815 -- 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 "TechScribe" wrote in message ... I want to print team rosters in an existing MS Word document, each team appearing on its own copy of the document. The number of team members varies from team to team. Access contains several hundred names in the Employees table. The employees are members of 57 teams, each employee being on only one team. A second table contains the names and descriptions of the teams. The query in Access combines both tables in one record for each employee. To clarify, I mean that each record contains one employee name, the name of the team, and the team information. (I agree that successive records contain duplicate information, but I have not normalized the employee table, so it remains simple for the users.) If I could trap the team name in a temporary user-defined variable, the solution would be elegantly simple: Next RecordIF team name is same THEN MemberName I have not found such a user variable in MS Word documentation. I am hoping that I do not have to resort to macros. I am comfortable with VBA for Access, but have not done anything like that with MS Word. To complicate things a bit, I would like to add this document to a master document that contains two more sub-documents that need the same treatment, printing employee names by team. The master document would print a bundle of documents for each team. If you are curious, the documents in the bundle represent milestones in a large project that requires tracking. Right now, the team leaders manually fill in each document. I am trying to simplify their life and improve accuracy. Thank you for your valuable time. -- Write well, and do good works. |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge Several Names on One Doc Page, Then Different Names on Next
Doug's covered the "one-many" ground but in this point...
To complicate things a bit, I would like to add this document to a master document that contains two more sub-documents that need the same treatment, printing employee names by team. The master document would print a bundle of documents for each team. ....you may be able to get a Master document approach to work, and it may work well if you want to impose aand maintain a completely standard style and layout, but if you want flexibility and maintainability of the system as a whole it would probably be better to use separate documents and a macro to process them in turn to produce the bundle you want. Peter Jamieson "TechScribe" wrote in message ... I want to print team rosters in an existing MS Word document, each team appearing on its own copy of the document. The number of team members varies from team to team. Access contains several hundred names in the Employees table. The employees are members of 57 teams, each employee being on only one team. A second table contains the names and descriptions of the teams. The query in Access combines both tables in one record for each employee. To clarify, I mean that each record contains one employee name, the name of the team, and the team information. (I agree that successive records contain duplicate information, but I have not normalized the employee table, so it remains simple for the users.) If I could trap the team name in a temporary user-defined variable, the solution would be elegantly simple: Next RecordIF team name is same THEN MemberName I have not found such a user variable in MS Word documentation. I am hoping that I do not have to resort to macros. I am comfortable with VBA for Access, but have not done anything like that with MS Word. To complicate things a bit, I would like to add this document to a master document that contains two more sub-documents that need the same treatment, printing employee names by team. The master document would print a bundle of documents for each team. If you are curious, the documents in the bundle represent milestones in a large project that requires tracking. Right now, the team leaders manually fill in each document. I am trying to simplify their life and improve accuracy. Thank you for your valuable time. -- Write well, and do good works. |
#4
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge Several Names on One Doc Page, Then Different Names on N
That worked wonderfully, Doug. Specifically, the SET BOOKMARK did what I
wanted. I looked at SET BOOKMARK previously, but thought it pointed to a location. I did not realize it could serve as a local variable. I still have a related problem, though, at the beginning of the next page -- or is it at the end of the current page? I sort the Employees table by team name, in a manner similar to the examples you sent me to read. I SET teamName to the first team name. Using IF ... THEN ... ELSE, I test a member's team against teamName, printing the member's name if the team names match. Then using NEXTIF, I again test the member's team against teamName, getting the next record if they match. If the member's team name does not match teamName, that indicates the end of the current team, it does not get another record, and at the end of the document, MS Word starts another document page. That means that the last record fetched contains the first member of the next team. HERE IS THE PROBLEM: MS Word seems to fetch another record automatically when it starts a new page. As a result, I loose the record of the first member of the next team. QUESTION: How do I either suppress the automatic next-record fetch, or cause the record pointer to back up one record? Thank you for your time. TechScribe -- Write well, and do good works. "Doug Robbins - Word MVP" wrote: See the "Group Multiple items for a single condition" item on fellow MVP Cindy Meister's website at http://homepage.swissonline.ch/cindy...faq1.htm#DBPic Or take a look at the following Knowledge Base Article http://support.microsoft.com/default...b;en-us;211303 Or, maybe the following will show you how to do what you are after: http://cornell.veplan.net/article.aspx?&a=3815 -- 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 "TechScribe" wrote in message ... I want to print team rosters in an existing MS Word document, each team appearing on its own copy of the document. The number of team members varies from team to team. Access contains several hundred names in the Employees table. The employees are members of 57 teams, each employee being on only one team. A second table contains the names and descriptions of the teams. The query in Access combines both tables in one record for each employee. To clarify, I mean that each record contains one employee name, the name of the team, and the team information. (I agree that successive records contain duplicate information, but I have not normalized the employee table, so it remains simple for the users.) If I could trap the team name in a temporary user-defined variable, the solution would be elegantly simple: Next RecordIF team name is same THEN MemberName I have not found such a user variable in MS Word documentation. I am hoping that I do not have to resort to macros. I am comfortable with VBA for Access, but have not done anything like that with MS Word. To complicate things a bit, I would like to add this document to a master document that contains two more sub-documents that need the same treatment, printing employee names by team. The master document would print a bundle of documents for each team. If you are curious, the documents in the bundle represent milestones in a large project that requires tracking. Right now, the team leaders manually fill in each document. I am trying to simplify their life and improve accuracy. Thank you for your valuable time. -- Write well, and do good works. |
#5
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge Several Names on One Doc Page, Then Different Names on N
What do you have as the ELSE result?
-- 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 "TechScribe" wrote in message ... That worked wonderfully, Doug. Specifically, the SET BOOKMARK did what I wanted. I looked at SET BOOKMARK previously, but thought it pointed to a location. I did not realize it could serve as a local variable. I still have a related problem, though, at the beginning of the next page -- or is it at the end of the current page? I sort the Employees table by team name, in a manner similar to the examples you sent me to read. I SET teamName to the first team name. Using IF ... THEN ... ELSE, I test a member's team against teamName, printing the member's name if the team names match. Then using NEXTIF, I again test the member's team against teamName, getting the next record if they match. If the member's team name does not match teamName, that indicates the end of the current team, it does not get another record, and at the end of the document, MS Word starts another document page. That means that the last record fetched contains the first member of the next team. HERE IS THE PROBLEM: MS Word seems to fetch another record automatically when it starts a new page. As a result, I loose the record of the first member of the next team. QUESTION: How do I either suppress the automatic next-record fetch, or cause the record pointer to back up one record? Thank you for your time. TechScribe -- Write well, and do good works. "Doug Robbins - Word MVP" wrote: See the "Group Multiple items for a single condition" item on fellow MVP Cindy Meister's website at http://homepage.swissonline.ch/cindy...faq1.htm#DBPic Or take a look at the following Knowledge Base Article http://support.microsoft.com/default...b;en-us;211303 Or, maybe the following will show you how to do what you are after: http://cornell.veplan.net/article.aspx?&a=3815 -- 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 "TechScribe" wrote in message ... I want to print team rosters in an existing MS Word document, each team appearing on its own copy of the document. The number of team members varies from team to team. Access contains several hundred names in the Employees table. The employees are members of 57 teams, each employee being on only one team. A second table contains the names and descriptions of the teams. The query in Access combines both tables in one record for each employee. To clarify, I mean that each record contains one employee name, the name of the team, and the team information. (I agree that successive records contain duplicate information, but I have not normalized the employee table, so it remains simple for the users.) If I could trap the team name in a temporary user-defined variable, the solution would be elegantly simple: Next RecordIF team name is same THEN MemberName I have not found such a user variable in MS Word documentation. I am hoping that I do not have to resort to macros. I am comfortable with VBA for Access, but have not done anything like that with MS Word. To complicate things a bit, I would like to add this document to a master document that contains two more sub-documents that need the same treatment, printing employee names by team. The master document would print a bundle of documents for each team. If you are curious, the documents in the bundle represent milestones in a large project that requires tracking. Right now, the team leaders manually fill in each document. I am trying to simplify their life and improve accuracy. Thank you for your valuable time. -- Write well, and do good works. |
#6
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge Several Names on One Doc Page, Then Different Names on N
The ELSE result is empty.
-- Write well, and do good works. "Doug Robbins - Word MVP" wrote: What do you have as the ELSE result? -- 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 "TechScribe" wrote in message ... That worked wonderfully, Doug. Specifically, the SET BOOKMARK did what I wanted. I looked at SET BOOKMARK previously, but thought it pointed to a location. I did not realize it could serve as a local variable. I still have a related problem, though, at the beginning of the next page -- or is it at the end of the current page? I sort the Employees table by team name, in a manner similar to the examples you sent me to read. I SET teamName to the first team name. Using IF ... THEN ... ELSE, I test a member's team against teamName, printing the member's name if the team names match. Then using NEXTIF, I again test the member's team against teamName, getting the next record if they match. If the member's team name does not match teamName, that indicates the end of the current team, it does not get another record, and at the end of the document, MS Word starts another document page. That means that the last record fetched contains the first member of the next team. HERE IS THE PROBLEM: MS Word seems to fetch another record automatically when it starts a new page. As a result, I loose the record of the first member of the next team. QUESTION: How do I either suppress the automatic next-record fetch, or cause the record pointer to back up one record? Thank you for your time. TechScribe -- Write well, and do good works. "Doug Robbins - Word MVP" wrote: See the "Group Multiple items for a single condition" item on fellow MVP Cindy Meister's website at http://homepage.swissonline.ch/cindy...faq1.htm#DBPic Or take a look at the following Knowledge Base Article http://support.microsoft.com/default...b;en-us;211303 Or, maybe the following will show you how to do what you are after: http://cornell.veplan.net/article.aspx?&a=3815 -- 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 "TechScribe" wrote in message ... I want to print team rosters in an existing MS Word document, each team appearing on its own copy of the document. The number of team members varies from team to team. Access contains several hundred names in the Employees table. The employees are members of 57 teams, each employee being on only one team. A second table contains the names and descriptions of the teams. The query in Access combines both tables in one record for each employee. To clarify, I mean that each record contains one employee name, the name of the team, and the team information. (I agree that successive records contain duplicate information, but I have not normalized the employee table, so it remains simple for the users.) If I could trap the team name in a temporary user-defined variable, the solution would be elegantly simple: Next RecordIF team name is same THEN MemberName I have not found such a user variable in MS Word documentation. I am hoping that I do not have to resort to macros. I am comfortable with VBA for Access, but have not done anything like that with MS Word. To complicate things a bit, I would like to add this document to a master document that contains two more sub-documents that need the same treatment, printing employee names by team. The master document would print a bundle of documents for each team. If you are curious, the documents in the bundle represent milestones in a large project that requires tracking. Right now, the team leaders manually fill in each document. I am trying to simplify their life and improve accuracy. Thank you for your valuable time. -- Write well, and do good works. |
#7
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Merge Several Names on One Doc Page, Then Different Names on N
Aha! Your question really bugged me. I think I know a solution now.
At the end of the page, I can save the non-team member's name with SET BOOKMARK and use that at the beginning of the next page. At the top of the first page I can test for record sequence number being "1" in the IF ... THEN ... ELSE and print the first member of the first team in the THEN part. If the sequence number is not "1", it tells me that I am not on the first page, therefore I can print the contents of the BOOKMARK in the ELSE part. I need to be careful about how I do the first NEXTIF at the top of the next page. You're a genius, Doug. Thanks. [Ummm ... izzat the right solution?] -- Write well, and do good works. "TechScribe" wrote: The ELSE result is empty. -- Write well, and do good works. "Doug Robbins - Word MVP" wrote: What do you have as the ELSE result? -- 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 "TechScribe" wrote in message ... That worked wonderfully, Doug. Specifically, the SET BOOKMARK did what I wanted. I looked at SET BOOKMARK previously, but thought it pointed to a location. I did not realize it could serve as a local variable. I still have a related problem, though, at the beginning of the next page -- or is it at the end of the current page? I sort the Employees table by team name, in a manner similar to the examples you sent me to read. I SET teamName to the first team name. Using IF ... THEN ... ELSE, I test a member's team against teamName, printing the member's name if the team names match. Then using NEXTIF, I again test the member's team against teamName, getting the next record if they match. If the member's team name does not match teamName, that indicates the end of the current team, it does not get another record, and at the end of the document, MS Word starts another document page. That means that the last record fetched contains the first member of the next team. HERE IS THE PROBLEM: MS Word seems to fetch another record automatically when it starts a new page. As a result, I loose the record of the first member of the next team. QUESTION: How do I either suppress the automatic next-record fetch, or cause the record pointer to back up one record? Thank you for your time. TechScribe -- Write well, and do good works. "Doug Robbins - Word MVP" wrote: See the "Group Multiple items for a single condition" item on fellow MVP Cindy Meister's website at http://homepage.swissonline.ch/cindy...faq1.htm#DBPic Or take a look at the following Knowledge Base Article http://support.microsoft.com/default...b;en-us;211303 Or, maybe the following will show you how to do what you are after: http://cornell.veplan.net/article.aspx?&a=3815 -- 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 "TechScribe" wrote in message ... I want to print team rosters in an existing MS Word document, each team appearing on its own copy of the document. The number of team members varies from team to team. Access contains several hundred names in the Employees table. The employees are members of 57 teams, each employee being on only one team. A second table contains the names and descriptions of the teams. The query in Access combines both tables in one record for each employee. To clarify, I mean that each record contains one employee name, the name of the team, and the team information. (I agree that successive records contain duplicate information, but I have not normalized the employee table, so it remains simple for the users.) If I could trap the team name in a temporary user-defined variable, the solution would be elegantly simple: Next RecordIF team name is same THEN MemberName I have not found such a user variable in MS Word documentation. I am hoping that I do not have to resort to macros. I am comfortable with VBA for Access, but have not done anything like that with MS Word. To complicate things a bit, I would like to add this document to a master document that contains two more sub-documents that need the same treatment, printing employee names by team. The master document would print a bundle of documents for each team. If you are curious, the documents in the bundle represent milestones in a large project that requires tracking. Right now, the team leaders manually fill in each document. I am trying to simplify their life and improve accuracy. Thank you for your valuable time. -- Write well, and do good works. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
mail merge - different last names? | Microsoft Word Help | |||
Word merge field names vs. Excel merge field names | Mailmerge | |||
In a merge how do I avoid names being skipped from page to page? | Mailmerge | |||
Why are names being duplicated when I merge? | Mailmerge | |||
mail merge field names | Mailmerge |