zoukankan      html  css  js  c++  java
  • C# PPT 查找替换

     public void ReplaceAll(string OldText,string NewText)
            {
                int num = PageNum();
                for (int j = 1; j <=num; j++)
                {
                  POWERPOINT.Slide   slide = objPresSet.Slides[j];
                    for (int i = 1; i <=slide.Shapes.Count; i++)
                    {
                        POWERPOINT.Shape shape = slide.Shapes[i];
                        if (shape.TextFrame != null)
                        {
                            POWERPOINT.TextFrame textFrame = shape.TextFrame;
                            try
                            {
                                if (textFrame.TextRange != null)
                                {
                                    textFrame.TextRange.Replace(OldText, NewText);
                                }
                            }
                            catch
                            { }
                        }
                    }
                }
            }

       private void button3_Click(object sender, EventArgs e)
            {
                OperatePPT pOperatePPT = new OperatePPT();
                pOperatePPT.PPTOpen(this.textBox1.Text);
                pOperatePPT.ReplaceAll("闫磊", "闫磊 Email:gisworld@126.com");
            }

  • 相关阅读:
    Top 10 Product Manager Skills To Boost Your Resume In 2021
    大数据知识梳理
    B端产品如何设计权限系统?
    华三盒式交换机MAC、ARP、Route性能表项参数查询
    中了传说中的挖矿病毒
    SqlServer 2019 事务日志传送
    docker中生成的pdf中文是方框的解决方案
    The Live Editor is unable to run in the current system configuration
    2021 面试题大纲
    五分钟搞定Docker安装ElasticSearch
  • 原文地址:https://www.cnblogs.com/gisoracle/p/5964320.html
Copyright © 2011-2022 走看看