WebCommandButton 属性 (Publisher)WebCommandButton.PostFormData property (Publisher)

返回或设置一个**MsoTriState** 常量, 该常量指示在将表单数据提交到 web 服务器时指定的 web 命令按钮控件是否使用 Microsoft Visual Basic GetPost方法。Returns or sets an MsoTriState constant indicating whether the specified web command button control uses the Microsoft Visual Basic Get or Post method when submitting form data to a web server. 读/写。Read/write.



_表达式_一个代表**WebCommandButton** 对象的变量。expression A variable that represents a WebCommandButton object.

返回值Return value



属性值可以是一个 MsoTriState 常量声明在 Microsoft Office 类型库,如下表所示。The property value can be one of the MsoTriState constants declared in the Microsoft Office type library and shown in the following table.

常量Constant 说明Description
msoFalsemsoFalse 控件使用 Visual Basic Get 方法提交表单数据。The control uses the Visual Basic Get method to submit form data.
msoTruemsoTrue 控件使用 Visual Basic Post 方法提交表单数据。The control uses the Visual Basic Post method to submit form data. 默认的值。The default value.

对于 “重置” 命令按钮,将忽略此属性。This property is ignored for Reset command buttons.


本示例创建一个 web 表单 "提交" 命令按钮, 并设置在用户选择该按钮时要运行的脚本路径和文件名。This example creates a web form Submit command button and sets the script path and file name to run when a user chooses the button. 该示例还指定 web 表单应使用 Visual Basic Get方法提交表单数据。The example also specifies that the web form should use the Visual Basic Get method to submit form data.

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

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.