Thread: [Solved] Macro to remove MacroButtons
View Single Post
 
Old 05-20-2011, 06:00 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi ilkks,

Try something based on:
Code:
Sub Demo()
Dim oFld As Field
With ActiveDocument
  For Each oFld In .Fields
    If oFld.Type = wdFieldMacroButton Then
      If Trim(oFld.Code.Text) = "MACROBUTTON  MacroAddProduct Add new product" Then oFld.Delete
    End If
  Next
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote