Click here to Skip to main content
15,886,963 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to wait for a window to appear before sending keystrok using sendkeys? Pin
Luc Pattyn1-Oct-09 0:48
sitebuilderLuc Pattyn1-Oct-09 0:48 
QuestionIssues with XML Deserializing of List Pin
User 1278230-Sep-09 19:44
User 1278230-Sep-09 19:44 
AnswerRe: Issues with XML Deserializing of List Pin
SeMartens30-Sep-09 22:14
SeMartens30-Sep-09 22:14 
GeneralRe: Issues with XML Deserializing of List Pin
User 127821-Oct-09 6:01
User 127821-Oct-09 6:01 
GeneralRe: Issues with XML Deserializing of List Pin
SeMartens1-Oct-09 21:29
SeMartens1-Oct-09 21:29 
GeneralRe: Issues with XML Deserializing of List Pin
User 127822-Oct-09 10:01
User 127822-Oct-09 10:01 
GeneralRe: Issues with XML Deserializing of List Pin
User 127822-Oct-09 10:54
User 127822-Oct-09 10:54 
QuestionHow to create a powerpoint chart using C# code? Pin
Ahsan Nabi Khan30-Sep-09 19:36
Ahsan Nabi Khan30-Sep-09 19:36 
I have been using the following code from msdn to create a slide. But how to create a chart in a slide?


const string sTemplate = "C:\\Program Files\\Microsoft Office\\Templates\\Presentation Designs\\Blends.pot";
const string sPic = "C:\\WINNT\\Soap Bubbles.bmp";

PowerPoint.Application oApp = default(PowerPoint.Application);
PowerPoint.Presentation oPres = default(PowerPoint.Presentation);
PowerPoint.Slide oSlide = default(PowerPoint.Slide);
bool bAssistantOn = false;

//Start Powerpoint and make its window visible but minimized.
oApp = new PowerPoint.Application();
oApp.Visible = Office.MsoTriState.msoCTrue;// Microsoft.Office.Core.MsoTriState.msoCTrue;
oApp.WindowState = PowerPoint.PpWindowState.ppWindowMinimized;

//Create a new presentation based on the specified template.
oPres = oApp.Presentations.Open(sTemplate, Microsoft.Office.Core.MsoTriState.msoCTrue, Microsoft.Office.Core.MsoTriState.msoCTrue, Microsoft.Office.Core.MsoTriState.msoCTrue);


//Build Slide #1:
//Add text to the slide, change the font and insert/position a
//picture on the first slide.
oSlide = oPres.Slides.Add(1, PowerPoint.PpSlideLayout.ppLayoutTitleOnly);
{
oSlide.Shapes[1].TextFrame.TextRange.Text = "My Sample Presentation";
oSlide.Shapes[1].TextFrame.TextRange.Font.Name = "Comic Sans MS";
oSlide.Shapes[1].TextFrame.TextRange.Font.Size = 48;
}
oSlide.Shapes.AddTextbox(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal, 200, 200, 200, 200);// AddPicture(sPic, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue, 150, 150, 500, 350);
//oSlide.Shapes[1].Table.Rows[1].Cells[1].Borders[ PowerPoint.PpBorderType.ppBorderLeft].
oSlide = null;


PowerPoint.SlideShowSettings oSettings = default(PowerPoint.SlideShowSettings);
oSettings = oPres.SlideShowSettings;
oSettings.StartingSlide = 1;
oSettings.EndingSlide = 1;

//Prevent Office Assistant from displaying alert messages.
bAssistantOn = oApp.Assistant.On;
oApp.Assistant.On = false;

//Run the slide show and wait for the slide show to end.
oSettings.Run();
while (oApp.SlideShowWindows.Count >= 1) {
System.Windows.Forms.Application.DoEvents();
}
oSettings = null;

//Reenable Office Assisant, if it was on.
if (bAssistantOn) {
oApp.Assistant.On = true;
oApp.Assistant.Visible = false;
}

//Close the presentation without saving changes and quit PowerPoint.
oPres.Saved = Microsoft.Office.Core.MsoTriState.msoCTrue;
oPres.Close();
oPres = null;
oApp.Quit();
oApp = null;
GC.Collect();
QuestionIT Help desk Pin
mirianakoi30-Sep-09 17:33
mirianakoi30-Sep-09 17:33 
AnswerRe: IT Help desk Pin
Christian Graus30-Sep-09 17:36
protectorChristian Graus30-Sep-09 17:36 
GeneralRe: IT Help desk Pin
mirianakoi6-Oct-09 17:01
mirianakoi6-Oct-09 17:01 
GeneralRe: IT Help desk Pin
Shamaniac27-Jun-11 19:19
Shamaniac27-Jun-11 19:19 
AnswerRe: IT Help desk Pin
AndieDu30-Sep-09 17:42
AndieDu30-Sep-09 17:42 
GeneralRe: IT Help desk Pin
mirianakoi6-Oct-09 17:03
mirianakoi6-Oct-09 17:03 
AnswerRe: IT Help desk Pin
Blikkies30-Sep-09 19:52
professionalBlikkies30-Sep-09 19:52 
GeneralRe: IT Help desk Pin
Mycroft Holmes30-Sep-09 23:01
professionalMycroft Holmes30-Sep-09 23:01 
GeneralRe: IT Help desk Pin
Blikkies1-Oct-09 4:06
professionalBlikkies1-Oct-09 4:06 
GeneralRe: IT Help desk Pin
Mycroft Holmes1-Oct-09 12:25
professionalMycroft Holmes1-Oct-09 12:25 
GeneralRe: IT Help desk Pin
mirianakoi6-Oct-09 17:05
mirianakoi6-Oct-09 17:05 
QuestionProject_1.exe.config and Project_2.dll.config Pin
AndieDu30-Sep-09 16:44
AndieDu30-Sep-09 16:44 
AnswerRe: Project_1.exe.config and Project_2.dll.config Pin
Calla30-Sep-09 21:01
Calla30-Sep-09 21:01 
GeneralRe: Project_1.exe.config and Project_2.dll.config Pin
AndieDu1-Oct-09 13:43
AndieDu1-Oct-09 13:43 
AnswerRe: Project_1.exe.config and Project_2.dll.config Pin
AndieDu1-Oct-09 16:38
AndieDu1-Oct-09 16:38 
GeneralRe: Project_1.exe.config and Project_2.dll.config Pin
Calla1-Oct-09 20:14
Calla1-Oct-09 20:14 
Questionhow to display a string on website through windows form Pin
Barkha Shreri30-Sep-09 11:23
Barkha Shreri30-Sep-09 11:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.