This project has moved. For the latest updates, please go here.

PowerPoint API a few questions (about alignement)

Aug 20, 2014 at 11:30 AM
Hello,
I have been searching for 2 days, but found now answer.
I am adding a simple picture to my slide like this:
Shape ss = sl.Shapes.AddPicture(file,MsoTriState.msoCTrue,MsoTriState.msoCTrue,0,0);
how do I set the alignment of the picture inside the slide?
I want it to align center and middle (vertically/horizontally)

Also, a side question, how can I set the text color/background color of a textbox. I set the font name, size but I can't set the font color/background color:
Shape ss2 = sl.Shapes.AddTextbox(MsoTextOrientation.msoTextOrientationHorizontal, 0, 0, 200, 200);
                            ss2.TextFrame.TextRange.Text = lst[i].Subtitle;
                            ss2.TextFrame.TextRange.Font.Name = lst[i].text_font.Name;
                            ss2.TextFrame.TextRange.Font.Size = lst[i].text_font.Size;
                            ss2.TextFrame.AutoSize = PpAutoSize.ppAutoSizeShapeToFitText;
                            ss2.TextFrame.TextRange.ParagraphFormat.Alignment = PpParagraphAlignment.ppAlignCenter;
                            ss2.TextFrame.TextRange.ParagraphFormat.BaseLineAlignment = PpBaselineAlignment.ppBaselineAlignCenter;
Thanks!
Vlad