none
How can I get the attributes of title/text in Slide? RRS feed

  • Question

  • Hello,

    Now I can get the text and titles of a power point, but I want to get all attributes of the text, title (or any element) such as: color, font-size, position. How can I do this? Thank you so much.

    Monday, March 29, 2010 8:14 AM

Answers

  • Hi Asusu,

    Thanks for your question.

    From the sample code on MSDN you could get the SlidePart. We suggest you using the Productivity Tool to see how to retrieve and modify those text styles such as color, font and so on. This may be an easy way to help you understand the file format and how to retrieve/modify a specific element/attribute.

    1.      Create an empty pptx document, insert some text into it and save it, such as “source.pptx”.

    2.      Change the color or font of the source file and save it as “target.pptx”.

    3.      Open the Tool; click "Compare Files" to compare the “source.docx” and “target.docx” files.

    4.      In the "File Comparison" tab, click "View Part Diff" to show the differences between the selected two parts (in this case, we select “/ppt/slides/slide1.xml”) and which element determine the text style.

    5.       Click “View Part code” to see the complete sample code on how to retrieve and change these elements/attributes.

    Hope this helps. If you have any question, please let me know.

    Thanks,

    Lu

    • Marked as answer by Asusu Tuesday, March 30, 2010 7:02 AM
    Tuesday, March 30, 2010 6:28 AM

All replies

  • Hi Asusu,

    Thanks for your question.

    From the sample code on MSDN you could get the SlidePart. We suggest you using the Productivity Tool to see how to retrieve and modify those text styles such as color, font and so on. This may be an easy way to help you understand the file format and how to retrieve/modify a specific element/attribute.

    1.      Create an empty pptx document, insert some text into it and save it, such as “source.pptx”.

    2.      Change the color or font of the source file and save it as “target.pptx”.

    3.      Open the Tool; click "Compare Files" to compare the “source.docx” and “target.docx” files.

    4.      In the "File Comparison" tab, click "View Part Diff" to show the differences between the selected two parts (in this case, we select “/ppt/slides/slide1.xml”) and which element determine the text style.

    5.       Click “View Part code” to see the complete sample code on how to retrieve and change these elements/attributes.

    Hope this helps. If you have any question, please let me know.

    Thanks,

    Lu

    • Marked as answer by Asusu Tuesday, March 30, 2010 7:02 AM
    Tuesday, March 30, 2010 6:28 AM
  • Hi Lu,

    That tool is very cool and powerful, It's help me a lot, thank you for your instructions.

    Wednesday, March 31, 2010 4:13 AM
  • Hi Asusu,

    Thanks for your feedback! There are many other functions in the Tool such as generating Open XML SDK source code based on document content, validating documents and displaying documentation for the SDK besides comparing two files. For more detailed information, you could refer to Forum FAQ Part2. If there is any problem or inconvenience during your using the Tool, or you have any feedback/suggesion, please let me know.

    Thanks,

    Lu

    Wednesday, March 31, 2010 5:03 AM