473,387 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

CommandButton Caption

Hey!
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 =
(MSForms.CommandButton)vButton.OLEFormat.Object;
vButtObj.Caption = "Values";

any idea on what i'm doing wrong?

Sep 29 '06 #1
1 3420
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 =
(MSForms.CommandButton)vButton.OLEFormat.Object;
vButton.GetType().InvokeMember("Caption", BindingFlags.SetProperty,
null, vButtObj, new object[] { "Values" });

Oct 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Wally | last post by:
I would like to have an image with a caption displayed below it. The size of the image will vary. The caption should not extend beyond the width of the image. How can I cause the text of the...
6
by: Bernd Smits | last post by:
Hi, I would like to delete a record (with commandbutton) of a table associated to a combobox, when I select a certain value in the combobox (the value I select is associated with the record that I...
1
by: altacct | last post by:
I've got a multi-page subform with a tab control on one of the pages. The code that moves you from page three to page four, which is where the tab is, changes the tab captions according to some...
0
by: Chenghui Li | last post by:
We have a problem with the Windows XP theme: We have a IDE which allows other developers to develop visual programs for their customers. Our IDE allow them to set font for window captions easyly...
11
by: Tomek Toczyski | last post by:
What is the best way to attach a caption to an image in xhtml? I can attach a caption to a table by a "<caption>" tag but I would like to do sth similar to an image. How to do it in a natural...
0
by: kar3n.chandra | last post by:
Hey, 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...
6
by: Bob Darlington | last post by:
I want to use the caption property for fields in a recordset as a condition in a loop. That is, I only want to consider those fields which have captions: For each fld in RecordsetName.Fields If...
9
by: Neal | last post by:
http://www.brassattackofspringfield.com/gigs.html CSS at http://www.brassattackofspringfield.com/default.css Opera and IE render caption as desired. Firefox does not. Why? And is there a fix?
2
by: kaokao1 | last post by:
(Please Excuse my poor English). Hello Friend, Receive a cordial greeting. Friend, please see if you could help me with the following thing: I opened a Sheet of Excel, then I inserted a...
9
by: leon Galushko | last post by:
Hi, I want to set a CommandButton (Click - Event) to let the programm code (below) progress. The question is how is that exactly to do on the point. The as boolean declared variable...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.