設定母片的背景顏色

VSTO


 PowerPoint.Presentation presentation =

                Globals.ThisAddIn.Application.Presentations.Open("Setting Background Color of Master Slide.ppt", Office.MsoTriState.msoFalse, Office.MsoTriState.msoFalse, Office.MsoTriState.msoTrue);

            presentation.SlideMaster.Background.Fill.ForeColor.RGB = -654262273;

Aspose.Slides


 //實例化代表簡報檔案的 Presentation 類別

using (PresentationEx pres = new PresentationEx())

{

	//將母版投影片的背景顏色設為森林綠

	pres.Masters[0].Background.Type = BackgroundTypeEx.OwnBackground;

	pres.Masters[0].Background.FillFormat.FillType = FillTypeEx.Solid;

	pres.Masters[0].Background.FillFormat.SolidFillColor.Color = Color.ForestGreen;

	//將簡報寫入磁碟

	pres.Save("Setting Background Color of Master Slide.pptx", SaveFormat.Pptx);

下載範例程式碼