DavG63
12-03-2015, 05:18 AM
Hi
This is something that is probably really quite simple but I've never come across it before.
I have four checkboxes within a single frame on a userform. Anytime I've added checkboxes before they would automatically show up as 'false', i.e. blank.
On this occasion however, when I call up the Userform, they're appearing as greyed-out and with a tick in them. Is there a reason for this? Have I unintentionally done something that I didn't think I'd done?
Thanks
Update: As is always the case, the moment I hit 'post' inspiration struck.
I have various Custom Document Properties which hold the values of the comboboxes in the Userform and recall them each time the file is opened. I had tried to do the same with the checkbox values using
If Not (IsEmpty(ActiveDocument.CustomDocumentProperties("Second"))) Then
Dim iSecond As String
If ActiveDocument.CustomDocumentProperties("Second") <> 0 Then
iSecond = ActiveDocument.CustomDocumentProperties("Second")
Me.CheckBox1.Value = iSecond
Else
Me.ComboBox1.Value = ""
End If
End If
This was why the boxes were greyed out with ticks in them. If I remove the above code all is well.
My question is now, how can I use a Custom Document Property to store the value of the checkbox and recall it? Will this still work as it does with my other Custom Document Properties?
ActiveDocument.CustomDocumentProperties.Add _Name:="Second", LinkToContent:=False, Value:="", _
Type:=msoPropertyTypeString
Dav
This is something that is probably really quite simple but I've never come across it before.
I have four checkboxes within a single frame on a userform. Anytime I've added checkboxes before they would automatically show up as 'false', i.e. blank.
On this occasion however, when I call up the Userform, they're appearing as greyed-out and with a tick in them. Is there a reason for this? Have I unintentionally done something that I didn't think I'd done?
Thanks
Update: As is always the case, the moment I hit 'post' inspiration struck.
I have various Custom Document Properties which hold the values of the comboboxes in the Userform and recall them each time the file is opened. I had tried to do the same with the checkbox values using
If Not (IsEmpty(ActiveDocument.CustomDocumentProperties("Second"))) Then
Dim iSecond As String
If ActiveDocument.CustomDocumentProperties("Second") <> 0 Then
iSecond = ActiveDocument.CustomDocumentProperties("Second")
Me.CheckBox1.Value = iSecond
Else
Me.ComboBox1.Value = ""
End If
End If
This was why the boxes were greyed out with ticks in them. If I remove the above code all is well.
My question is now, how can I use a Custom Document Property to store the value of the checkbox and recall it? Will this still work as it does with my other Custom Document Properties?
ActiveDocument.CustomDocumentProperties.Add _Name:="Second", LinkToContent:=False, Value:="", _
Type:=msoPropertyTypeString
Dav