View Single Post
 
Old 01-10-2018, 09:36 AM
Mbrandt5 Mbrandt5 is offline Windows 7 64bit Office 2013
Novice
 
Join Date: Jan 2018
Posts: 2
Mbrandt5 is on a distinguished road
Default Overwriting Textbox "Property" Value

The question is how can I use the following method to update the property Value of a textbox, and have it saved as if the userform was created in Visual Basic Editor.

While I know many people have asked this question in the past...
I have not seen answers saying how to execute it with out storing the values in a separate location.

The Saving Would Preferably Save As If The Whole Userform Was Recreated With New Default Values.

Attached is a reference value to the property "Value" that I am referring to.

If anyone knows of a simple code to overwrite Controls default values, it would be greatly appreciated. Below is a possible wrap for it.

Code:
  
Private Sub UpdateControls_Click()

    Dim CTRL As Control

    With ActiveDocument
    
            For Each CTRL In UserForm1.Controls
        
                If (TypeName(CTRL) = "TextBox" or TypeName(CTRL) = "CheckBox") Then
        
                    'OverWrite controls Userform Initialization Value with Current Value 

            Next CTRL

    End With

End Sub
Attached Images
File Type: png Property Value.png (11.1 KB, 12 views)
Reply With Quote