プレゼンテーションを作成、管理する
このページでは、プレゼンテーションに関連する特定の概要タスク(次に例を示します)の実行方法について説明します。
- プレゼンテーションを作成する
- 既存のプレゼンテーションをコピーする
以降のパラグラフでは、これらのタスクについて詳しく説明します。
空のプレゼンテーションを作成する
プレゼンテーションを作成するには、次の例に示すように、presentations コレクションで create メソッドを使用します。
この例では、指定したタイトルの空のプレゼンテーションを作成します。
Google ドライブのフォルダを操作する
Google Slides API を使用して、指定したドライブ フォルダ内に直接プレゼンテーションを作成するオプションはありません。デフォルトでは、作成されたプレゼンテーションはドライブのルートフォルダに保存されます。
ただし、ドライブ フォルダにファイルを保存する方法は他に 2 つあります。
どちらの方法でも、適切な Drive API スコープを追加して呼び出しを承認する必要があります。
共有ドライブ フォルダ内でファイルを移動または作成するには、共有ドライブのサポートを実装するをご覧ください。
既存のプレゼンテーションをコピーする
プレゼンテーションをコピーするには、Drive API の files().copy メソッドを使用します。
次の例では、プレゼンテーションのタイトルと新しいドライブ ファイルの名前の両方に指定された文字列を使用して、既存のプレゼンテーションをコピーします。
呼び出しを承認するには、適切な Drive API スコープを使用する必要があります。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-12-21 UTC。
[null,null,["最終更新日 2024-12-21 UTC。"],[[["This page explains how to create new Google Slides presentations and copy existing ones programmatically."],["Creating presentations involves using the Slides API's `presentations.create` method to generate a blank presentation with a specified title."],["Copying presentations leverages the Drive API's `files.copy` method to duplicate an existing presentation, allowing for a new title."],["Presentations are saved to the user's root Drive folder by default, but can be moved or created in specific folders using the Drive API."]]],["This content outlines two primary actions: creating and copying presentations using Google Slides API. To create, the `presentations.create` method is used, generating a blank presentation with a specified title. To copy, the `files().copy` method from the Drive API is employed, requiring a source presentation ID and a new title. By default presentations are created in the users root folder, but the document explains how they can be moved or created in a specific folder using the Drive API. Code samples are provided in various languages.\n"]]