I’ve been working on a project which involves adding shapes to a PowerPoint slide using VBA.
One big big problem with PowerPoint is that there is no longer any macro recorder. This means you can’t get information about methods and properties by recording the steps you perform to, for example, add a shape to a slide. In other programs you can get a lot of useful information from recorded macros – in PowerPoint – nada!
So, if you, like me are struggling to make sense of a language that uses such wonderfully nonsensical properties like TextFrame.TextRange then here is the benefit of my research.
Here, in no particular order, is a grab bag of MSDN articles and references for adding and formatting (and adding text to) shapes in PowerPoint using VBA. Enjoy! and if you have any additional useful resources, please add them to the comments to keep us all from going crazy!
Constants to use with the SchemeColor property
http://msdn.microsoft.com/en-us/library/office/bb230611(v=office.12).aspx
ColorFormat object
Properties you can use to color an object – eg its fill, font, outline and so on:
http://msdn.microsoft.com/en-us/library/office/bb265494(v=office.12).aspx
TextRange.font property
How to configure a font for a shape:
http://msdn.microsoft.com/en-us/library/office/ff744240.aspx
LineFormat object
How to configure the line and arrowhead for a line or shape with a border
http://msdn.microsoft.com/en-us/library/office/aa220968(v=office.11).aspx
Shapes Object
How to create a shape on a PowerPoint slide
http://msdn.microsoft.com/en-us/library/office/ff746621.aspx
Shape.height property
Measured in (Oh so helpful) points (72 to the inch)
http://msdn.microsoft.com/en-us/library/office/ff744642.aspx
Shapes members
Some things you can add to a slide:
http://msdn.microsoft.com/en-us/library/office/ff745286.aspx
Shapes.AddShape method
How to add a shape to a PowerPoint slide:
http://msdn.microsoft.com/en-us/library/office/ff744336.aspx
An explanation of working with text in a shape
aka Microsoft’s attempt to explain why you need to use TextFrame.TextRange to add text to a shape!:
http://msdn.microsoft.com/en-us/library/office/aa198526(v=office.10).aspx
The MsoAutoShapeType Enumeration
ie how you can find what a shape is called so you can add it to a slide:
http://msdn.microsoft.com/en-us/library/aa432469(v=office.12).aspx
ParagraphFormat.Alignment property
How to align text in a shape in PowerPoint – :
http://msdn.microsoft.com/en-us/library/office/ff744029.aspx
Info on the TextFrame.TextRange property in PowerPoint:
http://msdn.microsoft.com/en-us/library/office/ff744793.aspx
Info about the TextFrame members in PowerPoint:
http://msdn.microsoft.com/en-us/library/office/ff745830.aspx
Post a Comment
Please feel free to add your comment here. Thank you!