2
我正在編程創建一個C#中的PowerPoint 2007演示文稿,但是當我添加文本時,第二行是縮進的。在UI中,我將通過進入Home-> Paragraph->縮進並將「Before Text」設置爲「0」並將Special設置爲「(none)」來設置它。我怎樣才能以編程方式完成同樣的事情?如何使用PowerPoint API控制懸掛縮進?
PowerPoint.Application app = new PowerPoint.Application();
PowerPoint.Presentation p = app.Presentations.Add(Office.MsoTriState.msoTrue);
app.Visible = Office.MsoTriState.msoTrue;
PowerPoint.CustomLayout customLayout = p.SlideMaster.CustomLayouts[PowerPoint.PpSlideLayout.ppLayoutText];
PowerPoint.Slide slide = p.Slides.AddSlide(p.Slides.Count + 1, customLayout);
PowerPoint.Shape textShape = slide.Shapes[2];
textShape.TextFrame.TextRange.ParagraphFormat.Bullet.Type = PowerPoint.PpBulletType.ppBulletNone;
PowerPoint.TextRange range1 = textShape.TextFrame.TextRange.InsertAfter(@"Just enough text so that wrapping occurs.");
range1.Font.Size = 54;
p.SaveAs(@"c:\temp\test1.pptx", PowerPoint.PpSaveAsFileType.ppSaveAsDefault, Office.MsoTriState.msoTrue);
p.Close();
app.Quit();
那麼...我如何溝懸掛縮進?
您擊中了頭部!謝謝史蒂夫! –
發生我剛剛在同一個釘子上跳動。 ;-) –