このトピックでは、ページ設定オブジェクト、ページ幅、ページの拡大縮小率、ページ高さの操作など、プレゼンテーションドキュメントのページ設定の高度な操作について説明します。
ページ設定オブジェクトを取得する
構文
Expression.ActivePresentation.PageSetup式: ドキュメントタイプのアプリケーションオブジェクト。
例
async function example() { await instance.ready(); const app = instance.Application; // プレゼンテーションオブジェクトを取得します。 const presentation = await app.ActivePresentation; // ページ設定オブジェクトを取得します。 const pageSetup = await presentation.PageSetup; }
ページ幅を取得する
構文
Expression.ActivePresentation.PageSetup.SlideWidth式: ドキュメントタイプのアプリケーションオブジェクト。
例
async function example() { await instance.ready(); const app = instance.Application; // プレゼンテーションオブジェクトを取得します。 const presentation = await app.ActivePresentation; // ページ設定オブジェクトを取得します。 const pageSetup = await presentation.PageSetup; // ページ幅を取得します。 const slideWidth = await pageSetup.SlideWidth; console.log(slideWidth); }
ページの高さを取得する
構文
Expression.ActivePresentation.PageSetup.SlideHeight式: ドキュメントタイプのアプリケーションオブジェクト。
例
async function example() { await instance.ready(); const app = instance.Application; // プレゼンテーションオブジェクトを取得します。 const presentation = await app.ActivePresentation; // ページ設定オブジェクトを取得します。 const pageSetup = await presentation.PageSetup; // ページの高さを取得します。 const slideHeight = await pageSetup.SlideHeight; console.log(slideHeight); }
ページの拡大縮小率を取得する
構文
Expression.ActivePresentation.PageSetup.SlideRatio式: ドキュメントタイプのアプリケーションオブジェクト。
戻り値
パラメーター
タイプ
説明
Ratio
number
ページの拡大縮小率。
例
async function example() { await instance.ready(); const app = instance.Application; // プレゼンテーションオブジェクトを取得します。 const presentation = await app.ActivePresentation; // ページ設定オブジェクトを取得します。 const pageSetup = await presentation.PageSetup; // ページの拡大縮小率を取得します。 const slideHeight = await pageSetup.SlideRatio; console.log(slideHeight); }