4

PowerPoint 小技巧 - 隱藏投影片

 3 years ago
source link: https://blog.darkthread.net/blog/hide-pptx-slides/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

PowerPoint 小技巧 - 隱藏投影片

2021-03-27 09:30 AM 0 916

我做投影片喜歡修修改改,有時想講的太多時間太少,不得不跳過某幾張投影片,但常常稍後改變主意把它們加回去,此時便可善用 PowerPoint 的好用功能 - 隱藏投影片。

使用方法很簡單,如下圖所示,由左側功能窗格投影片的右鍵選單按下【隱藏投影片】即可,隱藏的投影片會淡化,編號數字則會劃上斜線作為標示:

被隱藏的投影片會保留在 pptx 裡,但播放時不會顯示,之後可再視需要取消隱藏。

還有一種情境,我習慣在會議通知就附上投影片,方便與會人員於會前了解議題,會議上只交換意見形成共識,開會比較有效率。而有些敏感內容我只想在會議上說明,不適合寫成檔案流傳,此時可借用隱藏投影片功能將敏感內容藏起來,利用另存 PDF 時預設忽略隱藏投影片的特性,可產生不含機敏資料的文件檔案:

PDF 不能被編輯,如果你想產生一版拿掉隱藏投影片的 pptx,則可借助 Open XML SDK,寫一小段 C# 程式就能實現:

using System;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Presentation;
using DocumentFormat.OpenXml.Packaging;
using System.Linq;

namespace FilterPptx
{
    class Program
    {
        //REF: http://www.ericwhite.com/blog/deleting-slides-using-open-xml-sdk-2-0/
        static void Main(string[] args)
        {
            var ppt = PresentationDocument.Open("d:\\source.pptx", true);
            var prznt = ppt.PresentationPart.Presentation; 
            var slideList = prznt.SlideIdList;

            foreach (var slide in ppt.PresentationPart.SlideParts) {
                if (slide.Slide.Show != null && !slide.Slide.Show) {
                    var slideRefId = ppt.PresentationPart.GetIdOfPart(slide);
                    var slideId = slideList.ChildElements.FirstOrDefault(o => ((SlideId)o).RelationshipId == slideRefId);
                    if (slideId != null) slideList.RemoveChild(slideId);
                    if (prznt.CustomShowList != null) {
                        foreach (var custShow in prznt.CustomShowList.Elements<CustomShow>()) {
                            if (custShow.SlideList != null) {
                                var entry = custShow.SlideList.ChildElements.FirstOrDefault(
                                    o => ((SlideListEntry)o).Id == slideRefId);
                                if (entry != null) custShow.SlideList.RemoveChild(entry);
                            }
                        }
                    }
                    ppt.PresentationPart.DeletePart(slideRefId);
                }
            }
            ppt.SaveAs("d:\\filtered.pptx");
            Console.WriteLine("Hello World!");
        }
    }
}

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK