我使用C#创建了一个PowerPoint演示文稿:
现在,我该如何改变
PowerPoint.Application powerpointApplication;
PowerPoint.Presentation pptPresentation;
PowerPoint.Slide Slide;
// Create an instance of PowerPoint.
powerpointApplication = new PowerPoint.ApplicationClass();
// Create a PowerPoint presentation.
pptPresentation = powerpointApplication.Presentations.Add(
Microsoft.Office.Core.MsoTriState.msoTrue);
// Create empty slide
Slide = pptPresentation.Slides.Add(1, PowerPoint.PpSlideLayout.ppLayoutBlank);
TextRange objTextRng = objSlide.Shapes[1].TextFrame.TextRange;
objTextRng.Text = "Remote sensing calendar 1";
objTextRng.Font.Name = "Comic Sans MS";
objTextRng.Font.Size = 48;
// TODO: change color
// objTextRng.Font.Color
// Save presentation
pptPresentation.SaveAs( BasePath + "result\\2_example.ppt",
PowerPoint.PpSaveAsFileType.ppSaveAsDefault,
MsoTriState.msoTrue // TODO: что за параметр???
);
pptPresentation.Close();
现在,我该如何改变
objTextRng
的字体颜色呢?
range.Font.Color.RGB = 0x0000FF;
- 同样,蓝色将是range.Font.Color.RGB = 0xFF0000;
,以此类推。(*:实际上它是RGB格式,但它是大端存储,这意味着字节从右到左存储,而不是从左到右。) - BrainSlugs83