Solved Copy format in CommandBar (1 Viewer)

zelarra821

Registered User.
Local time
Today, 20:48
Joined
Jan 14, 2019
Messages
809
I have the following procedure to create a custom context menu:

Code:
Sub MenuContextual()
    On Error Resume Next
    Dim myBar As CommandBar
    CommandBars("ShortcutMenu").Delete
    Set myBar = CommandBars _
        .Add(Name:="ShortcutMenu", Position:=msoBarPopup, Temporary:=True)
    With myBar
        .Controls.Add Type:=msoControlButton, ID:=19
        .Controls.Add Type:=msoControlButton, ID:=22
    End With
    Set myBar = Nothing
End Sub

I need to add Format Copy but I don't know the ID.

Does anyone know or where can I consult it?

Thanks.
 

zelarra821

Registered User.
Local time
Today, 20:48
Joined
Jan 14, 2019
Messages
809
Thank you.

I have a list that I downloaded from a Spanish website about Access, but the IDs that are referenced to the format, none is what I am looking for. Hence I asked.
 

isladogs

MVP / VIP
Local time
Today, 19:48
Joined
Jan 14, 2017
Messages
18,217
I'm still running the code Micron provided but a quick web search for Office FaceID Format Painter suggests you need ID = 108
 

zelarra821

Registered User.
Local time
Today, 20:48
Joined
Jan 14, 2019
Messages
809
That's it, but it's not available, I don't know why

ScreenShot001.jpg
 

zelarra821

Registered User.
Local time
Today, 20:48
Joined
Jan 14, 2019
Messages
809
Code:
Sub MenuContextual()
    On Error Resume Next
    Dim myBar As CommandBar
    CommandBars("ShortcutMenu").Delete
    Set myBar = CommandBars _
        .Add(Name:="ShortcutMenu", Position:=msoBarPopup, Temporary:=True)
    With myBar
        .Controls.Add Type:=msoControlButton, ID:=19
        .Controls.Add Type:=msoControlButton, ID:=22
        .Controls.Add Type:=msoControlButton, ID:=108

    End With
    Set myBar = Nothing
End Sub
 

Users who are viewing this thread

Top Bottom