Excel.DocumentProperties class

ブックのプロパティを表します。

Extends

注釈

[ API セット: ExcelApi 1.7 ]

プロパティ

author

ブックの作成者。

category

ブックのカテゴリ。

comments

ブックのコメント。

company

ブックの会社。

context

オブジェクトに関連付けられている要求コンテキスト。 これにより、アドインのプロセスが Office ホスト アプリケーションのプロセスに接続されます。

creationDate

ブックの作成日を取得します。

custom

ブックのカスタム プロパティのコレクションを取得します。

keywords

ブックのキーワード。

lastAuthor

ブックの最後の作成者を取得します。

manager

ブックのマネージャー。

revisionNumber

ブックのリビジョン番号を取得します。

subject

ブックの件名。

title

ブックのタイトル。

メソッド

load(options)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(propertyNames)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(propertyNamesAndPaths)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

set(properties, options)

オブジェクトの複数のプロパティを同時に設定します。 適切なプロパティを持つプレーン オブジェクトまたは同じ型の別の API オブジェクトを渡すことができます。

set(properties)

既存の読み込まれたオブジェクトに基づいて、オブジェクトに複数のプロパティを同時に設定します。

toJSON()

API オブジェクトが に渡されたときにより便利な出力を提供するために、JavaScript toJSON() メソッドを JSON.stringify()オーバーライドします。 (JSON.stringifyさらに、渡される オブジェクトの メソッドを呼び出 toJSON します)。元の Excel.DocumentProperties オブジェクトは API オブジェクトですが、メソッドは、元の toJSON オブジェクトから読み込まれた子プロパティの浅いコピーを含むプレーンな JavaScript オブジェクト (として Excel.Interfaces.DocumentPropertiesData型指定) を返します。

プロパティの詳細

author

ブックの作成者。

author: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.7 ]

category

ブックのカテゴリ。

category: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.7 ]

comments

ブックのコメント。

comments: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.7 ]

company

ブックの会社。

company: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.7 ]

context

オブジェクトに関連付けられている要求コンテキスト。 これにより、アドインのプロセスが Office ホスト アプリケーションのプロセスに接続されます。

context: RequestContext;

プロパティ値

creationDate

ブックの作成日を取得します。

readonly creationDate: Date;

プロパティ値

Date

注釈

[ API セット: ExcelApi 1.7 ]

custom

ブックのカスタム プロパティのコレクションを取得します。

readonly custom: Excel.CustomPropertyCollection;

プロパティ値

注釈

[ API セット: ExcelApi 1.7 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/26-document/custom-properties.yaml

await Excel.run(async (context) => {
  // Load the keys and values of all custom properties.
  const customDocProperties = context.workbook.properties.custom;
  customDocProperties.load(["key", "value"]);
  await context.sync();

  // Log each custom property to the console.
  // Note that your document may have more properties than those you have set using this snippet.
  customDocProperties.items.forEach((property) => {
    console.log(`${property.key}:${property.value}`);
  });
});

keywords

ブックのキーワード。

keywords: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.7 ]

lastAuthor

ブックの最後の作成者を取得します。

readonly lastAuthor: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.7 ]

manager

ブックのマネージャー。

manager: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.7 ]

revisionNumber

ブックのリビジョン番号を取得します。

revisionNumber: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.7 ]

subject

ブックの件名。

subject: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.7 ]

title

ブックのタイトル。

title: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.7 ]

メソッドの詳細

load(options)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(options?: Excel.Interfaces.DocumentPropertiesLoadOptions): Excel.DocumentProperties;

パラメーター

options
Excel.Interfaces.DocumentPropertiesLoadOptions

読み込むオブジェクトのプロパティのオプションを提供します。

戻り値

load(propertyNames)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(propertyNames?: string | string[]): Excel.DocumentProperties;

パラメーター

propertyNames

string | string[]

読み込むプロパティを指定するコンマ区切り文字列または文字列の配列。

戻り値

load(propertyNamesAndPaths)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(propertyNamesAndPaths?: {
            select?: string;
            expand?: string;
        }): Excel.DocumentProperties;

パラメーター

propertyNamesAndPaths

{ select?: string; expand?: string; }

propertyNamesAndPaths.select は、読み込むプロパティを指定するコンマ区切り文字列で propertyNamesAndPaths.expand 、読み込むナビゲーション プロパティを指定するコンマ区切りの文字列です。

戻り値

set(properties, options)

オブジェクトの複数のプロパティを同時に設定します。 適切なプロパティを持つプレーン オブジェクトまたは同じ型の別の API オブジェクトを渡すことができます。

set(properties: Interfaces.DocumentPropertiesUpdateData, options?: OfficeExtension.UpdateOptions): void;

パラメーター

properties
Excel.Interfaces.DocumentPropertiesUpdateData

メソッドが呼び出されるオブジェクトのプロパティに等形的に構造化されたプロパティを持つ JavaScript オブジェクト。

options
OfficeExtension.UpdateOptions

properties オブジェクトが読み取り専用プロパティを設定しようとした場合にエラーを抑制するオプションを提供します。

戻り値

void

set(properties)

既存の読み込まれたオブジェクトに基づいて、オブジェクトに複数のプロパティを同時に設定します。

set(properties: Excel.DocumentProperties): void;

パラメーター

戻り値

void

toJSON()

API オブジェクトが に渡されたときにより便利な出力を提供するために、JavaScript toJSON() メソッドを JSON.stringify()オーバーライドします。 (JSON.stringifyさらに、渡される オブジェクトの メソッドを呼び出 toJSON します)。元の Excel.DocumentProperties オブジェクトは API オブジェクトですが、メソッドは、元の toJSON オブジェクトから読み込まれた子プロパティの浅いコピーを含むプレーンな JavaScript オブジェクト (として Excel.Interfaces.DocumentPropertiesData型指定) を返します。

toJSON(): Excel.Interfaces.DocumentPropertiesData;

戻り値