sandysharma
Member
Hi Everyone,
Need help with .onaction
I need to open a folder window when someone clicks on PDF file msocontrolbutton but not sure how would I apply the code to open window folder in the below code. Tried Shell but did not work. Need help on the bold line.
Need help with .onaction
I need to open a folder window when someone clicks on PDF file msocontrolbutton but not sure how would I apply the code to open window folder in the below code. Tried Shell but did not work. Need help on the bold line.
Code:
Sub Custom_PopUpMenu_1()
Dim menuItem As CommandBarPopup
' Add the popup menu.
With Application.CommandBars.Add(Name:=Mname, Position:=msoBarPopup, _
MenuBar:=False, Temporary:=True)
' Next, add a menu that contains one button named PDF Files.
With .Controls.Add(Type:=msoControlButton)
.Caption = "PDF Files"
'.FaceId = 73
.OnAction = "shell explorer.exe C:\Users\sandeep20583\Desktop\Reporting - 2017\Contracts\Contracts - Signed PDFs"
End With
End With
End Sub
Last edited by a moderator: