Office.AddBindingFromPromptOptions interface
プロンプトを構成し、作成されるバインドを識別するためのオプションを提供します。
注釈
使用元
例
// Add a binding to the document by prompting the user to select a cell in the document.
function addBinding() {
const bindings = Office.context.document.bindings;
const options: Office.AddBindingFromPromptOptions = {
id: "prompt-binding",
promptText: "Select a cell"
};
const callback = (asyncResult: Office.AsyncResult<Office.Binding>) => {
if (asyncResult.status === Office.AsyncResultStatus.Failed) {
console.error(asyncResult.error.message);
return;
}
console.log(`Created binding "${asyncResult.value.id}" of type "${asyncResult.value.type}".`);
};
bindings.addFromPromptAsync(Office.BindingType.Text, options, callback);
}
プロパティ
| async |
コールバックに渡される AsyncResult オブジェクトの asyncContext プロパティで変更されずに返される、任意の型のユーザー定義項目。 |
| id | バインドの一意の ID。 指定されていない場合は自動生成されます。 |
| prompt |
Specifies the string to display in the prompt UI that tells the user what to select. Limited to 200 characters. promptText 引数が渡されない場合、"選択してください" と表示されます。 |
| sample |
Specifies a table of sample data displayed in the prompt UI as an example of the kinds of fields (columns) that can be bound by your add-in. TableData オブジェクトで提供されるヘッダーは、フィールド選択 UI で使用されるラベルを指定します。 注: このパラメーターは、Access のアドインでのみ使用されます。 It is ignored if provided when calling the method in an add-in for Excel. |
プロパティの詳細
asyncContext
コールバックに渡される AsyncResult オブジェクトの asyncContext プロパティで変更されずに返される、任意の型のユーザー定義項目。
asyncContext?: any
プロパティ値
any
id
バインドの一意の ID。 指定されていない場合は自動生成されます。
id?: string
プロパティ値
string
promptText
Specifies the string to display in the prompt UI that tells the user what to select. Limited to 200 characters. promptText 引数が渡されない場合、"選択してください" と表示されます。
promptText?: string
プロパティ値
string
sampleData
警告
この API は非推奨になりました。
Microsoft Access is no longer supported.
Specifies a table of sample data displayed in the prompt UI as an example of the kinds of fields (columns) that can be bound by your add-in. TableData オブジェクトで提供されるヘッダーは、フィールド選択 UI で使用されるラベルを指定します。
注: このパラメーターは、Access のアドインでのみ使用されます。 It is ignored if provided when calling the method in an add-in for Excel.
sampleData?: Office.TableData