VBA Snippets
FormField_CheckboxExists
Public Function FormField_CheckboxExists(ByVal sCheckBoxName As String, _
Optional ByVal bInformUser As Boolean = False) _
As Boolean
Dim svalue As String
On Error GoTo AnError
FormField_CheckboxExists = True
svalue = ActiveDocument.FormFields(sCheckBoxName).CheckBox.Value
Exit Function
AnError:
FormField_CheckboxExists = False
If bInformUser = True Then
Call MsgBox("CheckBox Form Field : " & sCheckBoxName & " does not exist.")
End If
End Function
FormField_CheckboxGet
Public Function FormField_CheckboxGet(ByVal sCheckBoxName As String) As Boolean
On Error GoTo AnError
FormField_CheckboxGet = ActiveDocument.FormFields(sCheckBoxName).CheckBox.Value
If gbDEBUG = False Then Exit Function
AnError:
Call Error_Handle("FormField_CheckboxGet", msMODULENAME, 1, _
"")
End Function
FormField_TextBoxExists
Public Function FormField_TextBoxExists(ByVal sTextBoxName As String, _
Optional ByVal bInformUser As Boolean = False) _
As Boolean
Dim svalue As String
On Error GoTo AnError
FormField_TextBoxExists = True
svalue = ActiveDocument.FormFields(sTextBoxName).Result
Exit Function
AnError:
FormField_TextBoxExists = False
If bInformUser = True Then
Call MsgBox("TextBox Form Field : " & sTextBoxName & " does not exist.")
End If
End Function
FormField_TextBoxGet
Public Function FormField_TextBoxGet(ByVal sTextBoxName As String) As String
On Error GoTo AnError
FormField_TextBoxGet = ActiveDocument.FormFields(sTextBoxName).Result
If gbDEBUG = False Then Exit Function
AnError:
Call Error_Handle("FormField_TextBoxGet", msMODULENAME, 1, _
"")
End Function
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top