By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,894 Members | 2,185 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,894 IT Pros & Developers. It's quick & easy.

CommandButton Caption

P: n/a
i have a c# program opening and creating powerpoint slides and i
created a commandbutton on the slide. the problem i'm having is
changing the caption of the button.
i've placed the code below and the only error is
objValue.Caption="Values". when i run the program, the powerpoint
crashes at that command.
PowerPoint.Shape vButton = newSlide.Shapes.AddOLEObject(10, 500, 100,
30,"Forms.CommandButton.1",null,MsoTriState.msoFal se,null,0,null,MsoTriState.msoFalse);
vButton.Name = "cmdValue";
MSForms.CommandButton vButtObj =
vButtObj.Caption = "Values";

any idea on what i'm doing wrong?

Sep 29 '06 #1
Share this Question
Share on Google+
1 Reply

P: n/a
finally figured it out.. and hope this helps someone.. :)

PowerPoint.Shape vButton = currentSlide.Shapes.AddOLEObject(10, 500,
60, 30, "Forms.CommandButton.1", null, MsoTriState.msoFalse, null, 0,
null, MsoTriState.msoFalse);
vButton.Name = "cmdValues";
MSForms.CommandButton vButtObj =
vButton.GetType().InvokeMember("Caption", BindingFlags.SetProperty,
null, vButtObj, new object[] { "Values" });

Oct 3 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.