首页 新闻 会员 周边 捐助

VSTO 对PPT的操作

0
悬赏园豆:10 [已关闭问题] 关闭于 2013-08-19 15:45

最近才学习VSTO,对PPT的操作。

  private void AddTextBox(PowerPoint.Slide slide, string txtContent)         {             PowerPoint.Shape textbox;             textbox = slide.Shapes.AddTextbox(Office.MsoTextOrientation.msoTextOrientationHorizontal, 50, 100, 600, 50);//向当前PPT添加文本框             textbox.TextFrame.TextRange.Text = txtContent;//设置文本框的内容             textbox.TextFrame.TextRange.Font.Size = 48;//设置文本字体大小             textbox.TextFrame.TextRange.Font.Color.RGB = Color.DarkViolet.ToArgb();//设置文本颜色         }

        private void AddPicture(PowerPoint.Slide slide, PowerPoint.Shape shape, string filePath)         {             PowerPoint.Shape pic;             pic = slide.Shapes.AddPicture(filePath, Office.MsoTriState.msoFalse, Office.MsoTriState.msoTrue, shape.Left, shape.Top, shape.Width, shape.Height);             pic.Name = "图片";             pic.Height = shape.Height;             pic.Width = shape.Width;         }

        private void AddTextMessage(PowerPoint.Slide slide, PowerPoint.Shape shape, string txtContent)         {             PowerPoint.Shape textbox;             textbox = slide.Shapes.AddTextbox(Office.MsoTextOrientation.msoTextOrientationHorizontal, shape.Left, shape.Top, shape.Width, shape.Height);//向当前PPT添加文本框             textbox.Height = shape.Height;             textbox.Width = shape.Width;             textbox.TextFrame.TextRange.Text = txtContent;             textbox.TextFrame.TextRange.Font.Color.RGB = Color.Orange.ToArgb();         }

 

这几个方法该怎么调用啊?

emyaser的主页 emyaser | 初学一级 | 园豆:194
提问于:2013-08-19 09:27
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册