View Single Post
 
Old 01-13-2022, 10:31 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You need to store the value somewhere, or read it directly from the document e.g.


Code:
Private Sub CommandButton1_Click()
    ActiveDocument.Variables("varMultiDef").value = ChxMultiDef.value
    Unload Me
End Sub

Private Sub UserForm_Initialize()
Dim oVar As Variable
    For Each oVar In ActiveDocument.Variables
        Select Case oVar.Name
            Case Is = "varMultiDef"
                ChxMultiDef.value = oVar.value
            Case Else
        End Select
    Next oVar
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote