LoginSignup
1
0

More than 1 year has passed since last update.

C#/VB.NETでスライドの隠す方法と隠しを消す方法

Last updated at Posted at 2022-11-14

PowerPoint は、聴衆がスピーカーをより直感的に理解するのに役立つ優れたプレゼンテーション補助ツールです。 スピーカーがスライドを表示したくないが、ファイルから削除したくない場合は、Free Spire.Presentation for.NETを使用して特定のスライドを非表示にすることができます。 また、必要に応じていつでもスライドショーを再表示できます。

Free Spire.Presentation for .NETをインストールする

方法1:NuGetを介してFree Spire.Presentation for .NETをインストールする
「ツール」>「NuGetパッケージマネージャ」>「パッケージマネージャコンソール」の順に選択し、次のコマンドを実行します。

PM> Install-Package FreeSpire.Doc

方法2:プログラムに手動でSpire.presentation.dllファイルを導入する
Free Spire.Presentation for.NETをローカルにダウンロードし、解凍してインストールします。インストールが完了したら、Visual Studioを開いて新しいプロジェクトを作成し、右側のソリューションエクスプローラで「参照」を右クリックし、「参照を追加」>「参照」を選択して、インストールパスの下のBINフォルダのdllファイルを見つけ、「OK」をクリックして、プログラムに参照を追加します。

PowerPoint のスライドを隠す方法

  • PowerPoint のスライドを隠す手順は次のとおりです。
  • Presentation クラスのインスタンスを作成します。
  • Presentation.LoadFromFile() メソッドを使用して、PowerPoint ドキュメントをロードします。
  • Presentation.Slides[index] のプロパティを使用して、隠したいスライドを取得します。
  • ISlide.Hidden のプロパティを true に設定して、スライドを隠します。
  • Presentation.SaveToFile() メソッドを使用して、結果ドキュメントを保存します。

C#:

using Spire.Presentation;

namespace HideOrUnhideSlides
{
    class Program
    {
        static void Main(string[] args)
        {
           // PowerPointドキュメントをロードする
           Presentation ppt = new Presentation();
           ppt.LoadFromFile("Sample.pptx", FileFormat.Pptx2010);

           //2枚目のスライドを隠す
           ppt.Slides[1].Hidden = true;

           //結果ドキュメントを保存する
           ppt.SaveToFile("HiddenSlide.pptx", FileFormat.Pptx2010);
        }
    }
}

VB.NET:

Imports Spire.Presentation

Namespace HideOrUnhideSlides
    Friend Class Program
        Private Shared Sub Main(ByVal args As String())

            'PowerPointドキュメントをロードする
            Dim ppt As New Presentation()
            ppt. LoadFromFile("Sample.pptx", FileFormat.Pptx2010)

            '2枚目のスライドを隠す
            ppt. Slides(1).Hidden = True

            '結果ドキュメントを保存する
            ppt. SaveToFile("HiddenSlide.pptx", FileFormat.Pptx2010)
        End Sub
    End Class
End Namespace

2022-11-10_140003.png

PowerPoint のスライドの隠しを消す方法

  • PowerPoint のスライドの隠しを消す手順は次のとおりです。
  • Presentation クラスのインスタンスを作成します。
  • Presentation.LoadFromFile() メソッドを使用して、PowerPoint ドキュメントをロードします。
  • Presentation.Slides[index] のプロパティを使用して、隠しを消したいスライドを取得します。
  • ISlide.Hidden のプロパティを false に設定して、スライドの隠しを消します。
  • Presentation.SaveToFile() メソッドを使用して、結果ドキュメントを保存します。

C#:

using Spire.Presentation;

namespace HideOrUnhideSlides
{
    class Program
    {
        static void Main(string[] args)
        {
           
            // PowerPointドキュメントをロードする
            Presentation ppt = new Presentation();
            ppt.LoadFromFile("HiddenSlide.pptx", FileFormat.Pptx2010);

            //2枚目のスライドの隠しを消す
            ppt.Slides[1].Hidden = false;

            //結果ドキュメントを保存する
             ppt.SaveToFile("UnhiddenSlide.pptx", FileFormat.Pptx2010);

        }
    }
}

VB.NET:

Imports Spire.Presentation

Namespace HideOrUnhideSlides
    Friend Class Program
        Private Shared Sub Main(ByVal args As String())
           
            'PowerPointドキュメントをロードする
            Dim ppt As New Presentation()
            ppt. LoadFromFile("HiddenSlide.pptx", FileFormat.Pptx2010)

            '2枚目のスライドの隠しを消す
            ppt. Slides(1).Hidden = False

            '結果ドキュメントを保存する
            ppt. SaveToFile("UnhiddenSlide.pptx", FileFormat.Pptx2010)
        End Sub
    End Class
End Namespace

2022-11-10_135925.png

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0