翻譯|使用教程|編輯:李顯亮|2021-04-14 09:56:30.870|閱讀 189 次
概述:有時(shí)可能會(huì)遇到必須在PowerPoint演示文稿中以編程方式添加或更新此類注釋的情況。鑒于此,本文將介紹如何使用C ++以編程方式在PowerPoint演示文稿中使用筆記。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
Microsoft PowerPoint提供了向幻燈片中添加注釋的選項(xiàng)。這些注釋可以通過(guò)提供其他信息和上下文對(duì)演示者有所幫助。可能會(huì)遇到必須在PowerPoint演示文稿中以編程方式添加或更新此類注釋的情況。鑒于此,本文將介紹如何使用C ++以編程方式在PowerPoint演示文稿中使用筆記。
Aspose.Slides for C ++ 本機(jī)C ++庫(kù),支持創(chuàng)建,讀取和操作PowerPoint文件。該API還支持在PowerPoint演示文稿中使用筆記。您可以點(diǎn)擊下方按鈕下載體驗(yàn)。
以下是從PowerPoint幻燈片中讀取注釋的步驟。
以下是使用C ++從PowerPoint幻燈片中讀取注釋的示例代碼。
// Source PowerPoint file const String sourceFilePath = u"SourceDirectory\\slide-notes.pptx"; // Load the Presentation file SharedPtrpresentation = MakeObject(sourceFilePath); SharedPtrnotesManager = presentation->get_Slides()->idx_get(0)->get_NotesSlideManager(); // Read slide notes SharedPtrnote = notesManager->get_NotesSlide(); Console::WriteLine(note->get_NotesTextFrame()->get_Text());
Aspose.Slides for C ++使您能夠向PowerPoint幻燈片添加注釋。為此,請(qǐng)?jiān)L問(wèn)INotesSlideManager以獲取所需的幻燈片,然后添加注釋。以下是將注釋添加到特定PowerPoint幻燈片的步驟。
以下是使用C ++將注釋添加到特定PowerPoint幻燈片的示例代碼。
// File paths const String sourceFilePath = u"SourceDirectory\\SamplePresentation.pptx"; const String outputFilePath = u"OutputDirectory\\added-slide-notes.pptx"; // Load the Presentation file SharedPtrpresentation = MakeObject(sourceFilePath); SharedPtrnotesManager = presentation->get_Slides()->idx_get(0)->get_NotesSlideManager(); // Add new slide notes SharedPtrnote = notesManager->AddNotesSlide(); // Set the note text note->get_NotesTextFrame()->set_Text(u"Test"); // Save Presentation file presentation->Save(outputFilePath, Aspose::Slides::Export::SaveFormat::Pptx);
要更新便箋,請(qǐng)使用INotesSlideManager檢索現(xiàn)有便箋,然后更新便箋文本。以下是更新PowerPoint幻燈片的注釋的步驟。
以下是使用C ++更新PowerPoint幻燈片注釋的示例代碼。
// File paths const String sourceFilePath = u"SourceDirectory\\slide-notes.pptx"; const String outputFilePath = u"OutputDirectory\\updated-slide-notes.pptx"; // Load the Presentation file SharedPtrpresentation = MakeObject(sourceFilePath); SharedPtrnotesManager = presentation->get_Slides()->idx_get(0)->get_NotesSlideManager(); // Access slide notes SharedPtrnote = notesManager->get_NotesSlide(); // Update the notes note->get_NotesTextFrame()->set_Text(u"Test Updated"); // Save Presentation file presentation->Save(outputFilePath, Aspose::Slides::Export::SaveFormat::Pptx);
通過(guò)檢索刪除的滑動(dòng)的音符 INotesSlideManager 用于該特定幻燈片,然后使用 RemoveNotesSlide() 方法。以下是從PowerPoint幻燈片中刪除筆記的步驟。
以下是使用C ++從PowerPoint幻燈片中刪除注釋的示例代碼。
// File paths const String sourceFilePath = u"SourceDirectory\\slide-notes.pptx"; const String outputFilePath = u"OutputDirectory\\removed-slide-notes.pptx"; // Load the Presentation file SharedPtrpresentation = MakeObject(sourceFilePath); SharedPtrnotesManager = presentation->get_Slides()->idx_get(0)->get_NotesSlideManager(); // Remove slide notes notesManager->RemoveNotesSlide(); // Save Presentation file presentation->Save(outputFilePath, Aspose::Slides::Export::SaveFormat::Pptx);
如果你想試用Aspose的全部完整功能,可聯(lián)系在線客服獲取30天臨時(shí)授權(quán)體驗(yàn)。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn