欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來(lái)到入門(mén)教程網(wǎng)!

C#教程

當(dāng)前位置:主頁(yè) > 軟件編程 > C#教程 >

在C#里面給PPT文檔添加注釋的實(shí)現(xiàn)代碼

來(lái)源:本站原創(chuàng)|時(shí)間:2020-01-10|欄目:C#教程|點(diǎn)擊: 次

平常開(kāi)會(huì)或者做總結(jié)報(bào)告的時(shí)候我們通常都會(huì)用到PowerPoint演示文稿,我們可以在單個(gè)幻燈片或者全部幻燈片里面添加注釋,這樣觀眾可以從注釋內(nèi)容里面獲取更多的相關(guān)信息。

有些朋友不清楚如何在幻燈片里面添加注釋,下面我跟大家分享一下如何在C#里面為幻燈片添加注釋。

在這里我使用了一個(gè)免費(fèi)控件——Free Spire.Presentation,有興趣的朋友可以下載使用。

需要添加的命名空間:

using Spire.Presentation;
using System.Drawing;

詳細(xì)步驟和代碼片段如下:

步驟1:新建一個(gè)Presentation對(duì)象,從系統(tǒng)里面加載Presentation文件。

Presentation presentation = new Presentation();
presentation.LoadFromFile("sample.pptx");

步驟2:調(diào)用CommentAuthorList.AddAuthor(author name, string initials) 方法來(lái)添加作者注釋。

ICommentAuthor author = presentation.CommentAuthors.AddAuthor("E-iceblue", "comment:");

步驟3:調(diào)用Call presentation.Slides[].AddComment() 方法來(lái)給某一張?zhí)囟ɑ脽羝砑幼⒔狻W⑨尩念惏芏嘈畔?,像添加注釋的作者、添加注釋的時(shí)間、添加注釋的位置和注釋的內(nèi)容。

presentation.Slides[1].AddComment(author, "This part is pretty important. Please pay attention to it", new System.Drawing.PointF(42, 4), DateTime.Now);

步驟4:保存并重新打開(kāi)Presentation演示文稿。

presentation.SaveToFile("PPTwithcomment.pptx", FileFormat.Pptx2010);
System.Diagnostics.Process.Start("PPTwithcomment.pptx");

效果圖:

全部代碼:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Spire.Presentation;
 
namespace PPTComment
{
  class Program
  {
    static void Main(string[] args)
    {
      //create PPT document and load file
      Presentation presentation = new Presentation();
      presentation.LoadFromFile("sample.pptx");
      //comment author
      ICommentAuthor author = presentation.CommentAuthors.AddAuthor("E-iceblue", "comment:");
      //add comment
      presentation.Slides[1].AddComment(author, "This part is pretty important. Please pay attention to it", new System.Drawing.PointF(42, 4), DateTime.Now);
      //save the document
      presentation.SaveToFile("PPTwithcomment.pptx", FileFormat.Pptx2010);
      System.Diagnostics.Process.Start("PPTwithcomment.pptx");
    }
  }
}

以上就是在C#里面給PPT文檔添加注釋的實(shí)現(xiàn)代碼,需要的朋友可以參考一下。

上一篇:httpwebreqeust讀取httponly的cookie方法

欄    目:C#教程

下一篇:C#遍歷文件夾及子目錄下所有圖片

本文標(biāo)題:在C#里面給PPT文檔添加注釋的實(shí)現(xiàn)代碼

本文地址:http://mengdiqiu.com.cn/a1/C_jiaocheng/5979.html

網(wǎng)頁(yè)制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語(yǔ)言數(shù)據(jù)庫(kù)服務(wù)器

如果侵犯了您的權(quán)利,請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有