Reputation: 21
I have the following PowerPoint 2010 c# add-in code (the "Test" button only). I don't understand why a slide created manually, using this CustomLayout with ppPlaceholderBody set to ppBulletNone, produces a bulleted text box placeholder. The slide master layout in PowerPoint looks fine with no bullet. I'm sure that there must be more to setting the bullet to none than I understand. Can anyone shed any light on this?
private void button4_Click(object sender, EventArgs e)
{
PowerPoint.CustomLayout ppCL = Globals.ThisAddIn.Application.ActivePresentation.SlideMaster.CustomLayouts.Add(
Globals.ThisAddIn.Application.ActivePresentation.SlideMaster.CustomLayouts.Count + 1);
ppCL.Name = "My Custom Master Layout - text without a bullet!";
PowerPoint.Shape ppShape = ppCL.Shapes.AddPlaceholder(PowerPoint.PpPlaceholderType.ppPlaceholderBody);
ppShape.TextFrame.TextRange.Text = "Candidate";
ppShape.TextFrame.TextRange.ParagraphFormat.Bullet.Type = PowerPoint.PpBulletType.ppBulletNone;
}
Thanks in advance for helping... I've been working on it for longer than I'd like to admit.
-Aaron
Upvotes: 1
Views: 1004
Reputation: 21
Here's the solution: the shape text needs to be set after the ppBulletNone is applied. This makes sense because the paragraph text was created using the default bullet and not automatically changed when the shape was changed. Duh.
Just flip the last two lines in the original question like so:
ppShape.TextFrame.TextRange.ParagraphFormat.Bullet.Type = PowerPoint.PpBulletType.ppBulletNone;
ppShape.TextFrame.TextRange.Text = "Candidate";
Anyone give me a point so that I can begin to help others?
Upvotes: 1