WebCommandButton.PostFormData property (Publisher)

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.



expression A variable that represents a WebCommandButton object.

Return value



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
msoFalse The control uses the Visual Basic Get method to submit form data.
msoTrue The control uses the Visual Basic Post method to submit form data. The default value.

This property is ignored for Reset command buttons.


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. 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

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.