PowerPoint change ink color (or active pen) via VBA or C#

27 views.netc++powerpointvba
0

After several hours of googling/searching/debugging I decided to ask.

How can you change active pen or just the color while inking in PowerPoint.

Scenario: Currently inking on my PPT with green pen and want to change it to red. Please note this isn’t during slidehow but in the powerpoint editing mode.

What I need is to either

  1. Change currently selected pen color
  2. Change currently selected pen

enter image description here

enter image description here

Upon futher research I found a code which clicks on items on the ribbon based on ID but I’m yet to locate appropriate IDs/actions to click on the pens.

var app = new Application();
app.Visible = MsoTriState.msoTrue;
var ppt = app.Presentations.Open( @"test.pptx" );

var control = app.CommandBars.FindControl(
    MsoControlType.msoControlButton,
    120 // ID
);

control.Execute();