Office アドインでGitHub Copilotの入力を求めるメッセージが表示される
Office アドイン プロンプト ライブラリは、Office アドインを開発するときにGitHub Copilotで使用するプロンプトの例のコレクションです。GitHub Copilotは、コードの記述に役立つ AI ペア プログラマです。 Visual Studio Code や Visual Studio など、多くのコード エディターの拡張機能として使用できます。 コード エディターを使用して拡張機能を直接インストールして起動できます。
この記事のプロンプトをコピーし、GitHub Copilot チャットに入力して実験を開始します。 また、GitHub の Office アドインプロンプトで GitHub からファイルをダウンロードして、コード エディターでプロンプト リストを開いて、GitHub でGitHub Copilotすることもできます。
重要
この記事のプロンプトは、GitHub Copilotで英語で動作するように設計されています。 Copilot が関連する応答を返すようにテストされていますが、生成 AI は本質的に変数応答を返すことができます。 アドインをユーザーに公開または配布する前に、GitHub Copilotによって生成されたコードの正確性を常に確認してください。
GitHub Copilotを使用して Office アドインを開発するための独自のプロンプトをカスタマイズすることをお勧めします。 このプロンプト ライブラリにアイデアを投稿するには、GitHub を通じて Office アドインのドキュメントに投稿するための ガイダンスを確認してください。 また、Office アドインのプロンプト フィードバックに関するアンケートを通じて 、プロンプトとフィードバックを共有することもできます。
プロンプトの例
次のセクションでは、アドインを開発および発行するときに複数のシナリオを求めるプロンプトを示します。
ヒント
プロンプトのアスタリスク間で語句を切り替えて、関連するシナリオを試します。
作業を開始するためのガイダンス
Show me the typical structure of an Office Add-in project and
explain the functionality of each file. Explain the steps and
commands to get started in *Visual Studio Code*.
アドイン プロジェクトの作成
ドキュメントをWord テンプレートとしてインポートする
Create an Office JavaScript add-in for *Word* to *import a
document as a template*. List the steps to follow in *Visual
Studio Code* to create the add-in and insert code snippets in
the correct files.
Excel でカスタム関数を作成する
Create an Office JavaScript Add-in for *Excel* to *create a
custom function in Excel*. List the steps to follow in *Visual
Studio Code* to create the add-in and insert code snippets in
the correct files.
PowerPointプレゼンテーション スライドにグラフィックスを挿入する
Create an Office JavaScript Add-in for *PowerPoint* to *insert
graphics into a presentation slide*. List the steps to follow in
*Visual Studio Code* to create the add-in and insert code snippets
in the correct files.
Excel アドインの機能を実装する
新しいワークシートの追加
Add a new worksheet *at the end* using the Excel JavaScript API.
表からデータを取得する
Retrieve the data in the range *A1:B3 on the first worksheet*
using the Excel JavaScript API.
グラフの作成
Insert a line chart titled *"My chart"* into the current worksheet
using the data *in the range A1:B3* using the Excel JavaScript API.
Excel で計算を実行するカスタム関数を作成する
Create a JavaScript custom function in Excel that conducts a
calculation.
イベントの処理
Handle an event *when selection changes in worksheet* using
Excel JavaScript API.
図形を作成する
Create *a yellow square* shape in the worksheet using the Excel
JavaScript API.
既存のブックのコピーを現在のブックに挿入する
Insert a workbook template as base64 in the current workbook using
insertWorksheetsFromBase64 Excel JavaScript API.
Word アドインの機能を実装する
段落を挿入する
Insert a paragraph with the content *"My paragraph"* at the start
of the document using the Word JavaScript API.
段落にスタイルを適用する
Apply the style *"Heading1"* to the first paragraph in the document
using the Word JavaScript API.
フォントを変更する
Change the font formatting of *the selected document text* using
the Word JavaScript API.
ドキュメントにテーブルを挿入する
Insert a table named "Sample table" with sample data in the
document using the Word JavaScript API.
コンテンツ コントロールを挿入する
Insert a content control labeled *"Sample Content Control"* into the
first paragraph and *set the content control's color to red* using
the Word JavaScript API.
コメントの追加
Insert a comment into the document selection using the Word JavaScript API
特定の場所にあるターゲット ドキュメントにドキュメントを挿入する
Import a file from local storage as a template to the current
document using the Word JavaScript insertFileFromBase64 API.
Excel、PowerPoint、または Word アドインの機能を実装する
ダイアログを追加する
Show a dialog in the application *when a user clicks a button
in the add-in* using the Office JavaScript API.
アクセス トークンを取得する
Get an access token in an Office Add-in using the Office
JavaScript API to authenticate the user with external services
or APIs.
アドインの発行に関するガイダンス
アドインをorganizationに配布する
Tell me how to deploy and distribute the local Office JavaScript
add-in code to *all employees in my organization* after
development. Provide the steps to follow.
アドインをアドイン ストアに配布する
Tell me how to deploy and distribute the local Office JavaScript
add-in code to the *add-in store* after development. Provide the
steps to follow.
関連項目
Office Add-ins