JohnnyLong
Programmer
I have a Word 2000 document with 8 comboboxes. I want to email this document to a client for them to select there values and email the document back. How do I save the values they have chosen in the comboboxes? I populate the combos in Document_Open and then:
Dim oProp As DocumentProperty
' Check if property exists
If Me.CustomDocumentProperties.Count > 0 Then
Set oProp = Me.CustomDocumentProperties.Item("SelLength"
If Not oProp Is Nothing Then bPropExists = True
End If
If Not bPropExists Then
' Add property to collection
Me.CustomDocumentProperties.Add "SelLength", False, _
msoPropertyTypeString, "Day(s)"
' set default selection
cboContractLength.ListIndex = 0
Else
For iCtr = 0 To cboContractLength.ListCount - 1
If cboContractLength.List(iCtr) = oProp.Value Then
cboContractLength.ListIndex = iCtr
Exit For
End If
Next
End If
This works fine for the first combobox and the value is saved. However if I replicate the code for the second combo I get 'Invalid Procedure call or argument' in Document_Close
sStartDay = cboStartDay.Value
Me.CustomDocumentProperties("SelDay"
= sStartDay
If I'm on the right lines, can I use CustomDocumentProperties as a collection? Confused.
Dim oProp As DocumentProperty
' Check if property exists
If Me.CustomDocumentProperties.Count > 0 Then
Set oProp = Me.CustomDocumentProperties.Item("SelLength"
If Not oProp Is Nothing Then bPropExists = True
End If
If Not bPropExists Then
' Add property to collection
Me.CustomDocumentProperties.Add "SelLength", False, _
msoPropertyTypeString, "Day(s)"
' set default selection
cboContractLength.ListIndex = 0
Else
For iCtr = 0 To cboContractLength.ListCount - 1
If cboContractLength.List(iCtr) = oProp.Value Then
cboContractLength.ListIndex = iCtr
Exit For
End If
Next
End If
This works fine for the first combobox and the value is saved. However if I replicate the code for the second combo I get 'Invalid Procedure call or argument' in Document_Close
sStartDay = cboStartDay.Value
Me.CustomDocumentProperties("SelDay"
If I'm on the right lines, can I use CustomDocumentProperties as a collection? Confused.