Hi Guys,
What i want to do is:
I want to create a Slide programmatically where a Table is on it! Here´s my Code: - String strTemplate;
-
strTemplate = template;
-
String tableSlide = @"C:\Temp\TableSlide_" + guid.ToString();
-
-
PowerPoint.Application objApp;
-
PowerPoint.Presentations objPresSet;
-
PowerPoint._Presentation objPres;
-
PowerPoint.Slides objSlides;
-
PowerPoint._Slide objSlide;
-
PowerPoint.TextRange objTextRng;
-
-
//Create a new presentation based on a template.
-
objApp = new PowerPoint.Application();
-
objApp.Visible = MsoTriState.msoTrue;
-
objPresSet = objApp.Presentations;
-
objPres = objPresSet.Open(strTemplate,
-
MsoTriState.msoFalse, MsoTriState.msoTrue, MsoTriState.msoTrue);
-
objSlides = objPres.Slides;
-
-
-
//Build Slide #1:
-
//Add text to the slide, change the font and insert/position a
-
//picture on the first slide.
-
objSlide = objSlides.Add(1,PowerPoint.PpSlideLayout.ppLayoutTable);
-
objSlide.HeadersFooters.Footer.Visible = MsoTriState.msoTrue;
-
objSlide.HeadersFooters.Footer.Text = "hallo";
-
-
-
objSlide.HeadersFooters.DateAndTime.Visible = MsoTriState.msoTrue;
-
objSlide.HeadersFooters.DateAndTime.UseFormat = MsoTriState.msoTrue;
-
objSlide.HeadersFooters.DateAndTime.Format = Microsoft.Office.Interop.PowerPoint.PpDateTimeFormat.ppDateTimeddddMMMMddyyyy;
-
objSlide.HeadersFooters.SlideNumber.Visible = MsoTriState.msoTrue;
-
objTextRng = objSlide.Shapes[1].TextFrame.TextRange;
-
objTextRng.Text = title;
-
-
-
// insert a PowerPoint table
-
// use data from a file
-
PowerPoint.Table objTable = null;
-
-
objTable= objSlide.Shapes.AddTable(4,4,36,138,648,294).Table;
-
-
-
objTable.Cell(1,1).Shape.TextFrame.TextRange.Text = "Stundennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn";
-
objTable.Cell(1, 2).Shape.TextFrame.TextRange.Text = "Fach";
-
objTable.Cell(1, 3).Shape.TextFrame.TextRange.Text = "Note";
-
-
-
-
-
-
-
objPres.SaveAs(tableSlide, Microsoft.Office.Interop.PowerPoint.PpSaveAsFileType.ppSaveAsDefault, MsoTriState.msoCTrue);
-
//Close the presentation without saving changes and quit PowerPoint.
-
objPres.Close();
-
objApp.Quit();
But if the String in Cell (1,1)for example, is very long then i want that the cell weigth goes bigger automatically! how can i do this?
Sorry for my bad english...:)
1 11784
No One? Can anybody help me?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Ata |
last post by:
Hello,
I am trying to copy the contents of the output of SQL Reporting Services to
a PowerPoint slide. For this, I am using SQL Reporting Services to obtain an
IMAGE stream, which I paste to the...
|
by: C Williams |
last post by:
Hi,
I am writing some VB.NET code that compiles to a dll. There is some
code within it that manipulates Powerpoint 2003.
The dll I am writing is for smart tags, and I am having trouble...
|
by: Joseph |
last post by:
I am trying to open a 3 powerpoint presentation simultaneously afte
each other without interruption, the operator of the application doe
not need to notice anything or interfere in the operation of...
|
by: Rach |
last post by:
Hi,
Does anyone know how to export charts/graphs from EXCEl
into Powerpoint-Microsoft Charts though VBA code. I would
like to import the underlying data with the chart as well.
I know we can...
|
by: Rut |
last post by:
Does anyone know how to start powerpoint from vb.net without the ppt
screen appearing. I want to keep it hidden? Using this code:
Try
pp = New PowerPoint.Application
pp.Visible =...
|
by: Rob |
last post by:
Hey folks, my mind is turning into mush...
I created a report tracking program in access that works beyond my
greatest expectations. So of course, I am constantly adding features
to make life...
|
by: akshar108 via DotNetMonster.com |
last post by:
TextFrame (unknown member) : Invalid request. This type of shape cannot have
a TextRange
i got this error while i m fetching text from textframe which is in the slide
my code is following can...
|
by: HibernatingBear |
last post by:
Hello,
I've been driving myself nuts trying to find a solution to this. I'm
still a relative newbie to C#, and would be grateful for any helpful
suggestions.
I'm trying to find a way to...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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...
|
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...
|
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: 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...
| |