![]() |
#1
|
|||
|
|||
![]()
Hi Community!
I got a problem. I'm printing a document from our companies crm with mailmerge. Now the problem is that objects have different attributes (different size) and so sometimes the table gehts filled nearly entirely sometimes its nearly empty ! So I looked for a makro to clean the table and found one working for me : Code:
Dim myTable As Table Dim myRow As Row Dim myCell As Cell Dim myRange As Range Dim IsEmpty As Boolean For Each myTable In ActiveDocument.Tables For Each myRow In myTable.Rows IsEmpty = True For Each myCell In myRow.Cells Set myRange = myCell.Range myRange.MoveEnd Unit:=wdCharacter, Count:=-1 If myRange.Text <> "" Then IsEmpty = False Next myCell If IsEmpty Then myRow.Delete Next myRow Next myTable Is there any possibilty that it automatically will be executed on the merged document! I'm looking forward to your answers regards Stefan PS: Sorry for my bad english ![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Ted C | Word VBA | 11 | 08-04-2014 06:31 AM |
![]() |
Noxas | Mail Merge | 1 | 07-17-2014 06:14 PM |
Save merged document as concatenated merge field values | texas791 | Word VBA | 4 | 02-25-2014 07:35 PM |
![]() |
JCInfo | Mail Merge | 4 | 12-02-2013 05:12 PM |
![]() |
mkoenig | Word VBA | 1 | 01-31-2010 02:47 AM |