Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Answer
how i change font type,size of ppt file in C# *Desktop App)
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Taimoor Hassan
10y
1.8k
1
Reply
i had already got the font name,size etc ..
this code extract the text and font size and name of ppt file .
now i want to change these properties pro-grammatically
string path = @"c:\users\taimoor\PPT\";
Microsoft.Office.Interop.PowerPoint.Application powerPointApp =
new Microsoft.Office.Interop.PowerPoint.Application();
PowerPoint.Presentations multiPresentations = powerPointApp.Presentations;
Microsoft.Office.Interop.PowerPoint.Presentation presentation = multiPresentations.Open(path + "Demo.pptx");
string presentationText = "";
string fonts = "";
for (int i = 0; i < presentation.Slides.Count; i++)
{
foreach (object item in presentation.Slides[i + 1].Shapes)
{
PowerPoint.Shape shape = (PowerPoint.Shape) item;
var slide = (PowerPoint.Slide) item;
foreach (var it in slide.Shapes)
{
if (shape.HasTextFrame == MsoTriState.msoTrue)
{
string c= shape.TextFrame.TextRange.Font.Size.ToString(CultureInfo.InvariantCulture);
textBox3.Text = c;
if (shape.TextFrame.HasText == MsoTriState.msoTrue)
{
PowerPoint.TextRange textRange = shape.TextFrame.TextRange;
string text = textRange.Text;
string font = Font.Name;
float size = Font.Size;
FontStyle style = Font.Style;
presentationText += text + " ";
// get the text size head and body
float fontSize = shape.TextFrame.TextRange.Font.Size;
// get the length of body text
int bodyLength = shape.TextFrame.TextRange.Length;
// get text of all body
string v = shape.TextFrame.TextRange.Text;
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
Date format issue in telerik:RadDatePicker
audio file