473,786 Members | 2,578 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Captio n="Values". when i run the program, the powerpoint
crashes at that command.
PowerPoint.Shap e vButton = newSlide.Shapes .AddOLEObject(1 0, 500, 100,
30,"Forms.Comma ndButton.1",nul l,MsoTriState.m soFalse,null,0, null,MsoTriStat e.msoFalse);
vButton.Name = "cmdValue";
MSForms.Command Button vButtObj =
(MSForms.Comman dButton)vButton .OLEFormat.Obje ct;
vButtObj.Captio n = "Values";

any idea on what i'm doing wrong?

Sep 29 '06 #1
1 3438
finally figured it out.. and hope this helps someone.. :)

PowerPoint.Shap e vButton = currentSlide.Sh apes.AddOLEObje ct(10, 500,
60, 30, "Forms.CommandB utton.1", null, MsoTriState.mso False, null, 0,
null, MsoTriState.mso False);
vButton.Name = "cmdValues" ;
MSForms.Command Button vButtObj =
(MSForms.Comman dButton)vButton .OLEFormat.Obje ct;
vButton.GetType ().InvokeMember ("Caption", BindingFlags.Se tProperty,
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
3948
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 caption to wrap so that it will stay within the (varying) width of the image? Any ideas?
6
4027
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 want to delete. For example: I have a form associated to a table, which has only one field (PatientN°), and a combobox (within the form) that contains the list of values (PatientN°) contained in the table. Now I would like to select a value in...
1
1823
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 information stored in a table. Only it's not working. Actually, it is working, and then it's unworking. The tab caption starts out "And...". Depending on what's in the table, the caption may get changed to "Or...". Here's the code that makes...
0
3051
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 (through a dialog). It works fine fo W98, 2000, NT, and XP is the theme is Classic. But on XP if the theme is "Windows XP", the we have a problem: if the developer set the caption font to be say, "Script" (and all non-default font), then the...
11
4211
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 way? -tt.
0
263
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 below and the only error is objValue.Caption="Values". when i run the program, the powerpoint crashes at that command.
6
3216
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 fld.Properties("Caption") <"" then do something The problem is that all fields are included, even those with no caption set. I've tried IsMissing, IsEmpty and IsNull for the test but none will filter
9
7276
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
1621
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 CommandButton on it, then I associated it with a Code, in such a way that when pick the button, the program runs. So far, everything goes well.
9
1417
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 "PROCEED" is turning "FALSE" after
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9496
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8989
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7512
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4066
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.