Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Thu May 06, 2021 6:42 pm

Hi,

I want to get text of title from master slide and replace text with given key but I can not get text from title.
Code snippet:
Code: Select all
string text = (slide.Shapes[0] as IAutoShape).TextFrame.Paragraphs[0].Text;


that code returns string empty . Is there any way to get title text from master slide?

omurertanis
 
Posts: 22
Joined: Tue Mar 30, 2021 7:56 pm

Fri May 07, 2021 5:45 am

Hello,

Thanks for your inquiry.
I simulated a PPT file and did an initial test with the following code, but I can get the title text from master slide. You can see whether my code is different from your own.
If there are still any issues, to help us investigate further, please provide us with your input file, you can upload it here or send it to us (support@e-iceblue.com) via email. Thanks in advance.
Code: Select all
            Presentation ppt = new Presentation();
            ppt.LoadFromFile("test.pptx");
            string text=null;
            foreach (IMasterSlide slide in ppt.Masters)
            {
                text = (slide.Shapes[0] as IAutoShape).TextFrame.Paragraphs[0].Text;
            }


Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Mon May 17, 2021 8:09 am

Hello,

How is your issue now? Could you please give us some feedback at your convenience?

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.Presentation