-2

I tried commandbars codes and excutemso but they didnt work and i realized that commandbars are surpersed in newest version of office How can i use it? Tnx for your time

  • I think the Button ID for ScreenClipping is 18674. See the last paragraph in https://stackoverflow.com/a/65711550/3654325 for how to find ID's, and the first sentence for a starting point for the code to trigger it. – Stax Oct 06 '21 at 00:10
  • Hi tnx a lot It was very helpful i excuted that code for drawing free shapes and it worked but i could not do screen clipping yet . My code is as follows application.commandbars.findcontrol(id:=18674).excute but it dosent work Please help me – MILLA KIANI Oct 08 '21 at 18:06
  • Please add your code to the question - this is the way Stackoverflow works, see e.g. [ask] – Ike Oct 11 '21 at 07:38

1 Answers1

0

CommandBars.ExecuteMso ("ScreenClipping")

In general, to identify a control on the Ribbon: Hover over the desired button until the name pops up and remember it > rightclick on the ribbon and click "Customise the Ribbon" > in the first column click "All Commands" (NOT All Tabs) > find the remembered name in the alphabetical list and hover over it until info pops up. The actual "Code" name for the button will be the one in brackets.

(I do not know why, but the Button ID Execute method doesn't seem to work on this command)

Stax
  • 469
  • 4
  • 15