发布服务器) (WebCommandButton.PostFormData 属性

返回或设置一个 MsoTriState 常量,该常量指示指定的 Web 命令按钮控件在将窗体数据提交到 Web 服务器时是否使用 Microsoft Visual Basic Get 或 Post 方法。 读/写。

语法

表达式。PostFormData

表达式 表示 WebCommandButton 对象的变量。

返回值

MsoTriState

备注

属性值可以是一个 MsoTriState 常量声明在 Microsoft Office 类型库,如下表所示。

常量 说明
msoFalse 控件使用 Visual Basic Get 方法提交表单数据。
msoTrue 控件使用 Visual Basic Post 方法提交表单数据。 默认的值。

对于“重置”命令按钮,将忽略此属性。

示例

此示例创建一个 Web 窗体“ 提交 命令”按钮,并设置用户选择该按钮时要运行的脚本路径和文件名。 该示例还指定 Web 窗体应使用 Visual Basic Get 方法提交窗体数据。

Dim shpNew As Shape 
 
Set shpNew = ActiveDocument.Pages(1).Shapes.AddWebControl _ 
 (Type:=pbWebControlCommandButton, Left:=150, _ 
 Top:=150, Width:=75, Height:=36) 
 
With shpNew.WebCommandButton 
 .ButtonText = "Submit" 
 .ButtonType = pbCommandButtonSubmit 
 .ActionURL = "https://www.tailspintoys.com/" _ 
 & "scripts/ispscript.cgi" 
 .PostFormData = msoFalse 
End With

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。