首页 > 解决方案 > powershell 将 viso 容器设置为自动调整内容

问题描述

任何人都可以帮我在 viso 中设置容器自动适合内容。

为了便于理解,请看下图

从

变得 变得

我试过用marco记录这个动作看命令

Application.ActiveWindow.Selection.SetContainerFormat visContainerFormatFitToContents

但我不知道如何通过 powershell 运行它

我试过了

$pages.selection.SetContainerFormat =2 

但有错误

The property 'SetContainerFormat' cannot be found on this object. Verify that the property exists and can be set.
At line:19 char:1
+ $pages.selection.SetContainerFormat =2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

标签: powershell

解决方案


这段代码是工作

$viso.ActiveWindow.Selection.SetContainerFormat(2)

推荐阅读