Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
sjamie sjamie is offline
external usenet poster
 
Posts: 1
Default How to Intercept the "Update All Labels" Button

I have a touchscreen laptop which causes my "Update All Labels" button
to malfunction during a mail merge according to http://support.microsoft.com/?kbid=898630.

I was able to use MVP Doug Robbins code below as a great workaround.
It runs perfectly as a MACRO that I initiate using a keyboard shortcut
but I would like for it to run whenever I press the "Update All
Labels" button instead. I tried saving it as a template and putting
it in Word's startup folder but that had no effect. What else shall I
do?


Sub MailMergePropagateLabel()
Dim atable As Table
Dim i As Long
Dim j As Long
Dim source As Cell
Dim target As Cell
Dim myrange As Range
Set atable = ActiveDocument.Tables(1)
Set source = atable.Cell(1, 1)
Set myrange = source.Range
myrange.Collapse wdCollapseStart
ActiveDocument.Fields.Add Range:=myrange, Text:="NEXT", _
PreserveFormatting:=False
source.Range.Copy
For j = 2 To atable.Columns.Count
Set target = atable.Cell(1, j)
If target.Range.Fields.Count 0 Then
target.Range.Paste
End If
Next j
For i = 2 To atable.Rows.Count
For j = 1 To atable.Columns.Count
Set target = atable.Cell(i, j)
If target.Range.Fields.Count 0 Then
target.Range.Paste
End If
Next j
Next i

atable.Cell(1, 1).Range.Fields(1).Delete

End Sub

 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge Labels "Update Labels" greyed out Dianne Griffin Microsoft Word Help 6 April 5th 23 11:31 AM
I want idMso for "Mailing" Tab button to add this button in custom ribbon tab [email protected] Mailmerge 1 August 6th 07 01:18 PM
I want idMso for "Mailing" Tab button to add this button in custom ribbon tab [email protected] Microsoft Word Help 0 August 6th 07 06:40 AM
I want idMso for "Mailing" Tab button to add this button in custom ribbon tab [email protected] New Users 0 August 3rd 07 03:47 PM
Mail Merge "Update all labels"...doesn't Amy Blankenship Mailmerge 5 December 21st 05 06:48 AM


All times are GMT +1. The time now is 02:25 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"