nick_harambee
asked on
i need a macro to add 'insert bookmark' to my right click menu
well the title says it all really, could someone please write me a macro that will add the insert bookmark function to the right click menu in Word 2002. i want to be able to save the macro in the normal template so that it will be available in all word docs.
thanks,
nick
thanks,
nick
Does opening the Main template (Normal.dot) and then saving the customized template help, rather that making a macro and running it every time.
ASKER
i have a few macros in my normal template that work fine in all word docs (and i am clear on how to do this), what i need is the specific macro for adding insert bookmark to the right click menu,
nick.
nick.
The context-sensitive right-click pop-up is not exposed for modification. You will need a button if you want to make it a bit quicker to add bookmarks.
ASKER
oh, well someone recently sent me a macro for adding 'paste unformatted text' to the right click menu, one macro for tables, and one for plain documents, and this works fine...so i figured this would be possible for other functions.
nick.
nick.
Well it's not the first time I've been completely wrong and it won't be the last. Perhaps you could post or point to it and we can adapt it for your new purpose.
ASKER
here is the macro that adds 'paste unformatted text' to the right click menu for both table and standard document. maybe you could adapt it. i won't be needing to insert bookmarks into tables so the macro should hopefully be simpler....
Private Sub Document_Open()
Call AddPasteSpecial
End Sub
Private Sub Document_New()
Call AddPasteSpecial
End Sub
Sub AddPasteSpecial()
Dim cb As CommandBar
Dim c As CommandBarButton
Set cb = Application.CommandBars("T able Text")
Set c = cb.FindControl(, , "VBAxPasteSpec")
If Not c Is Nothing Then
c.Delete
End If
Set c = cb.Controls.Add(msoControl Button, , , 4, True)
With c
.Caption = "Paste Unformatted Text"
.Style = msoButtonCaption
.TooltipText = "Paste Special"
.Tag = "VBAxPasteSpec"
.OnAction = "PasteUnformattedText"
End With
Set cb = Application.CommandBars("T ext")
Set c = cb.FindControl(, , "VBAxPasteSpec")
If Not c Is Nothing Then
c.Delete
End If
Set c = cb.Controls.Add(msoControl Button, , , 4, True)
With c
.Caption = "Paste Unformatted Text"
.Style = msoButtonCaption
.TooltipText = "Paste Special"
.Tag = "VBAxPasteSpec"
.OnAction = "PasteUnformattedText"
End With
End Sub
Sub PasteUnformattedText()
Selection.PasteSpecial Link:=False, DataType:=wdPasteText, Placement:= _
wdInLine, DisplayAsIcon:=False
End Sub
Private Sub Document_Open()
Call AddPasteSpecial
End Sub
Private Sub Document_New()
Call AddPasteSpecial
End Sub
Sub AddPasteSpecial()
Dim cb As CommandBar
Dim c As CommandBarButton
Set cb = Application.CommandBars("T
Set c = cb.FindControl(, , "VBAxPasteSpec")
If Not c Is Nothing Then
c.Delete
End If
Set c = cb.Controls.Add(msoControl
With c
.Caption = "Paste Unformatted Text"
.Style = msoButtonCaption
.TooltipText = "Paste Special"
.Tag = "VBAxPasteSpec"
.OnAction = "PasteUnformattedText"
End With
Set cb = Application.CommandBars("T
Set c = cb.FindControl(, , "VBAxPasteSpec")
If Not c Is Nothing Then
c.Delete
End If
Set c = cb.Controls.Add(msoControl
With c
.Caption = "Paste Unformatted Text"
.Style = msoButtonCaption
.TooltipText = "Paste Special"
.Tag = "VBAxPasteSpec"
.OnAction = "PasteUnformattedText"
End With
End Sub
Sub PasteUnformattedText()
Selection.PasteSpecial Link:=False, DataType:=wdPasteText, Placement:= _
wdInLine, DisplayAsIcon:=False
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks graham
all seems to be working fine
i have accepted your answer
nick
all seems to be working fine
i have accepted your answer
nick
T
Thanks Nick
For the interaction , the lesson, the points and the grade.
Cheers, Graham
For the interaction , the lesson, the points and the grade.
Cheers, Graham