Infopath 2010 Commandbar issue RRS feed

  • Question

  • I am trying to set teh default Pen Weight in Infopath. The current default has the ink entry with a very thin ballpoint effect.  We need a much thicker weight since the ink entry is getting scanned later.  I have been attempting to change the setting with my c# code behind using Commandbar

    I have been unable to find any documentation or reference material to get the code correct to to get the control id or the name of the pen weight, so i can  change the pen settings -- by guessing pretty much i was able to do a few things in the commandbar -- for instance the code below turns the ink eraser on -- i just do not know the ids/names for the pen type or weight

    CommandBars myCommand = (CommandBars)this.Application.ActiveWindow.CommandBars;
    myCommand["Ink"].Controls[4].Execute();  //this turns the ink eraser

    Friday, August 2, 2013 7:56 PM

All replies

  • Hi rcant55,

    I will consult my colleagues on this question, and it will take some time. Your patience will be greatly appreciated.



    Jeffrey Chen
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, August 5, 2013 7:27 AM
  • Hello,

    I don't think its possible to achieve with Office 2010 to set default Pen Weight in InfoPath. With InfoPath you have no programmatic access to any of the controls. You only have programmatic access to the XML nodes to which those controls are bound.

    With Office 2007, you could set the values through the CommandBars collection. But with Office 2010, the default ink weight is not a property that can be set through the CommandBars collection as its now a part of the ribbon controls.

    Hence even with Object model / API's, you would not be able to set the default Pen Weight in InfoPath.

    Hope this helps.

    Regards, Dhiraj(DJ)-MSFT |Microsoft Online Community Support

    Tuesday, October 1, 2013 10:17 PM