Visio.HyperlinkCollection class

ハイパーリンク コレクションを表します。

Extends

プロパティ

context

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

items

このコレクション内に読み込まれた子アイテムを取得します。

メソッド

getCount()

ハイパーリンクの数を取得します。

getItem(Key)

そのキー (名前または ID) を使用してハイパーリンクを取得します。

load(options)

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

load(propertyNames)

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

load(propertyNamesAndPaths)

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

toJSON()

API オブジェクトが JSON.stringify() に渡されるときに、より有用な出力を提供するために、JavaScript toJSON() メソッドをオーバーライドします。 (JSON.stringify は、渡されたオブジェクトの toJSON メソッドを呼び出します)。元の Visio.HyperlinkCollection オブジェクトが API オブジェクトであるのに対し、 toJSON メソッドは、コレクションの項目から読み込まれたプロパティの浅いコピーを含む "items" 配列を含むプレーンな JavaScript オブジェクト ( Visio.Interfaces.HyperlinkCollectionData として型指定された) を返します。

プロパティの詳細

context

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

context: RequestContext;

プロパティ値

items

このコレクション内に読み込まれた子アイテムを取得します。

readonly items: Visio.Hyperlink[];

プロパティ値

メソッドの詳細

getCount()

ハイパーリンクの数を取得します。

getCount(): OfficeExtension.ClientResult<number>;

返品

注釈

API セット: 1.1

getItem(Key)

そのキー (名前または ID) を使用してハイパーリンクを取得します。

getItem(Key: number | string): Visio.Hyperlink;

パラメーター

Key

number | string

キーは、取得するハイパーリンクの名前またはインデックスです。

返品

注釈

API セット: 1.1

load(options)

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

load(options?: Visio.Interfaces.HyperlinkCollectionLoadOptions & Visio.Interfaces.CollectionLoadOptions): Visio.HyperlinkCollection;

パラメーター

options

Visio.Interfaces.HyperlinkCollectionLoadOptions & Visio.Interfaces.CollectionLoadOptions

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

返品

Visio.run(session, function (ctx) {
    const activePage = ctx.document.getActivePage();
    const shapeName = "Manager Belt";
    const shape = activePage.shapes.getItem(shapeName);
    const shapeHyperlinks = shape.hyperlinks;
    shapeHyperlinks.load(["description", "address", "subAddress"]);
        ctx.sync().then(function () {
            for (let i = 0; i < shapeHyperlinks.items.length; i++) {
                const hyperlink = shapeHyperlinks.items[i];
                console.log(
                    "Description:"+hyperlink.description +"Address:"+hyperlink.address +"SubAddress:  " + 
                    hyperlink.subAddress);
            }
        });
}).catch(function(error) {
    console.log("Error: " + error);
    if (error instanceof OfficeExtension.Error) {
        console.log("Debug info: " + JSON.stringify(error.debugInfo));
    }
});

load(propertyNames)

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

load(propertyNames?: string | string[]): Visio.HyperlinkCollection;

パラメーター

propertyNames

string | string[]

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

返品

load(propertyNamesAndPaths)

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

load(propertyNamesAndPaths?: OfficeExtension.LoadOption): Visio.HyperlinkCollection;

パラメーター

propertyNamesAndPaths
OfficeExtension.LoadOption

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

返品

toJSON()

API オブジェクトが JSON.stringify() に渡されるときに、より有用な出力を提供するために、JavaScript toJSON() メソッドをオーバーライドします。 (JSON.stringify は、渡されたオブジェクトの toJSON メソッドを呼び出します)。元の Visio.HyperlinkCollection オブジェクトが API オブジェクトであるのに対し、 toJSON メソッドは、コレクションの項目から読み込まれたプロパティの浅いコピーを含む "items" 配列を含むプレーンな JavaScript オブジェクト ( Visio.Interfaces.HyperlinkCollectionData として型指定された) を返します。

toJSON(): Visio.Interfaces.HyperlinkCollectionData;

返品