473,399 Members | 4,254 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,399 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 3421
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.