Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Mail Merge

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 02-08-2019, 07:21 AM
Ali Mubarak Ali Mubarak is offline Windows XP Office 2010
Novice
 
Join Date: Feb 2019
Posts: 6
Ali Mubarak is on a distinguished road
Default Printing Letter with printing base on Title in Grid

Hi,




I tried to use the {MERGESEQ} with {SET KEY=""} but did not succeed.


Would be very thankful if resolved.


Ali Mubarak
Attached Files
File Type: xlsx Combinefile.xlsx (9.4 KB, 2 views)
File Type: docx Due Within 1 Month.docx (12.6 KB, 1 views)
Reply With Quote
  #2  
Old 02-08-2019, 02:05 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,109
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Since you haven't told us what you're trying to do and there's no field coding of any kind in your document - not even a single mergefield - we'd only be guessing what you're trying to achieve.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 02-08-2019, 07:17 PM
Ali Mubarak Ali Mubarak is offline Windows XP Office 2010
Novice
 
Join Date: Feb 2019
Posts: 6
Ali Mubarak is on a distinguished road
Default

Hi,

YOU are right there is no code in the word document. I copied the code from mail merge forum to print a bill for each customer in the attached format of word document. BUT culd not understand the loop and filter.

Greatful if you may help to create the macro for.



AlI Munarak.
Reply With Quote
  #4  
Old 02-08-2019, 07:30 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,109
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

From what I can deduce from your workbook and document, you can use Word's Catalogue/Directory Mailmerge facility for this (the terminology depends on the Word version). To see how to do so with any mailmerge data source supported by Word, check out my Microsoft Word Catalogue/Directory Mailmerge Tutorial in the 'Sticky' thread at the top of this forum:
http://www.msofficeforums.com/mail-m...-tutorial.html
The tutorial covers everything from list creation to the insertion & calculation of values in multi-record tables in letters. Do read the tutorial before trying to use the mailmerge document included with it.

Depending on what you're trying to achieve, the field coding for this can be complex. However, since the tutorial document includes working field codes for all of its examples, most of the hard work has already been done for you - you should be able to do little more than copy/paste the relevant field codes into your own mailmerge main document, substitute/insert your own field names and adjust the formatting to get the results you desire. For some worked examples, see the attachments to the posts at:
http://www.msofficeforums.com/mail-m...html#post23345
http://www.msofficeforums.com/mail-m...html#post30327

Another option would be to use a DATABASE field in a normal ‘letter’ mailmerge main document and a macro to drive the process. An outline of this approach can be found at: http://answers.microsoft.com/en-us/o...1-1996c14dca5d
Conversely, if you restructure your workbook so you can use it like a relational database (i.e. with a separate sheet with just a single instance of each of the grouping criteria, a DATABASE field in a normal ‘letter’ mailmerge main document could be used without the need for a macro. An outline of this approach can be found at:
https://answers.microsoft.com/en-us/...f-8642e46fa103
For a working example, see:
http://www.msofficeforums.com/mail-m...-multiple.html

As you can see from the above, it's quite possible to do what you appear to want to do without a macro.

Alternatively, you may want to try one of the Many-to-One Mail Merge add-ins, from:
Graham Mayor at http://www.gmayor.com/ManyToOne.htm; or
Doug Robbins at https://onedrive.live.com/?cid=5AEDC...43615E886B!566
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #5  
Old 02-08-2019, 08:35 PM
Ali Mubarak Ali Mubarak is offline Windows XP Office 2010
Novice
 
Join Date: Feb 2019
Posts: 6
Ali Mubarak is on a distinguished road
Default

I am greatful to you for such nice guid lines. I would go through the tutorial first and the said tool for writing the macro.

THANKS۔

AlI Mubarak
Reply With Quote
  #6  
Old 02-10-2019, 10:26 PM
Ali Mubarak Ali Mubarak is offline Windows XP Office 2010
Novice
 
Join Date: Feb 2019
Posts: 6
Ali Mubarak is on a distinguished road
Default

Hi,


First of all Thanks for guidance,


I read the Tutorial, and utilize the macro which is in attached file, but output is splitted/appears in multiple pages instead on one page for one customer.


Please guide me for the correction in macro.


Code file, Data file and Output File are attached.




Ali Mubarak
Attached Files
File Type: docx Output.docx (15.9 KB, 0 views)
File Type: doc Mailmerge Main Document.doc (40.0 KB, 1 views)
File Type: xlsx Combinefile.xlsx (9.5 KB, 1 views)
Reply With Quote
  #7  
Old 02-11-2019, 12:13 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,109
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

You haven't followed all of the instructions - your mailmerge main document is configured for a Letter merge but the tutorial says you must use a Catalog or Directory merge.

You also seem to have only copied & pasted the field coding from the tutorial into your own document without modifying anything to suit your actual mailmerge data. Simply pasting your mergefields onto the output displayed by the tutorial is not what the tutorial says you need to do.

And, as I have said before, none of this has anything to do with a macro!
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #8  
Old 02-11-2019, 03:07 AM
Ali Mubarak Ali Mubarak is offline Windows XP Office 2010
Novice
 
Join Date: Feb 2019
Posts: 6
Ali Mubarak is on a distinguished road
Default

Hi,


Yes, after Selecting the type as "Directory" the output of the bill starts consolidating on one page. I read the VB Scrip, it is good need little effort to incorpoare the scrip in the file.


Any ways Thank you for your generosity and guidance.


Regards,


Ali Mubarak
Reply With Quote
  #9  
Old 02-11-2019, 03:10 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,109
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Quote:
Originally Posted by Ali Mubarak View Post
Yes, after Selecting the type as "Directory" the output of the bill starts consolidating on one page. I read the VB Scrip, it is good need little effort to incorpoare the scrip in the file.
There is no 'VB Scrip' in your attachment. Neither does your attachment have the required changes to the field coding. Clearly you haven't paid attention to what the tutorial says or to the demonstration links I supplied.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #10  
Old 02-11-2019, 03:37 AM
Ali Mubarak Ali Mubarak is offline Windows XP Office 2010
Novice
 
Join Date: Feb 2019
Posts: 6
Ali Mubarak is on a distinguished road
Default

Hi,


I attached the output of the macro,



I assumed as the following is the VB script to merge the "Tables".


Merging to Tables

Any of the previous examples can produce their output in a table format. All you need to do is to replace the heading & data lines in the field code with an equivalent table. When you do so, however, each record becomes a one-row table, as per the ‘Calculating Group and Sub-Group Totals’ example (page 14). To turn that output into one table per group you can run the following ‘TableJoiner’ macro after completing the merge.
Sub TableJoiner()
Application.ScreenUpdating = False
Dim oPara As Paragraph
For Each oPara In ActiveDocument.Paragraphs
With oPara.Range
If .Information(wdWithInTable) = True Then
With .Next
If .Information(wdWithInTable) = False Then
If .Text = vbCr Then .Delete
End If
End With
End If
End With
Next
Application.ScreenUpdating = True
End Sub




Regards,


Ali Mubarak
Attached Files
File Type: doc Mailmerge Main Document.doc (39.5 KB, 1 views)
File Type: docx Directory1.docx (17.2 KB, 1 views)
Reply With Quote
  #11  
Old 02-11-2019, 01:59 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,109
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

You still have not made the required changes to the field coding. Until you do that you are just wasting time - yours and mine. Read the tutorial!
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing a letter sized document that contains an envelope page CyberChulo Word 5 11-01-2017 04:47 AM
Printing Document Title Automatically Khans_nytorv Word 3 06-14-2016 07:45 PM
How to add letter head picture to a section for printing juliem Word 4 10-12-2015 08:54 PM
Word documents all are now printing in the top right corner as well as cutting off some printing MattyJ Word 2 03-20-2015 10:15 AM
Non-Printing Graphics vs Printing v_kiviranna Drawing and Graphics 4 06-29-2010 07:04 AM


All times are GMT -7. The time now is 09:41 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft