Hello my document is attached. I keep getting this error on Windows XP SP3
behavior is like this:
4248 referenced in title block above.
If I click “End” on the error window, the macros ran. They didn’t work right, though, because the boxes didn’t check.
If I choose Debug, then the Visual Basic page shows up and highlights the first half-line of the programing.
Any ideas? Thanks, Midani[vba]Private Sub Document_Open()
If ActiveDocument.FormFields("text64").Result = "Yes" Then ActiveDocument.FormFields("Check1").CheckBox.Value = True
If ActiveDocument.FormFields("text64").Result = "No" Then ActiveDocument.FormFields("Check2").CheckBox.Value = True[/vba][vba]
If ActiveDocument.FormFields("text65").Result = "Inpatient" Then ActiveDocument.FormFields("Check3").CheckBox.Value = True
If ActiveDocument.FormFields("text65").Result = "ER/Outpatient" Then ActiveDocument.FormFields("Check4").CheckBox.Value = True
If ActiveDocument.FormFields("text65").Result = "DOA" Then ActiveDocument.FormFields("Check5").CheckBox.Value = True
If ActiveDocument.FormFields("text65").Result = "Nursing Home" Then ActiveDocument.FormFields("Check6").CheckBox.Value = True
If ActiveDocument.FormFields("text65").Result = "Hospice" Then ActiveDocument.FormFields("Check7").CheckBox.Value = True
If ActiveDocument.FormFields("text65").Result = "Residence" Then ActiveDocument.FormFields("Check8").CheckBox.Value = True
If ActiveDocument.FormFields("text65").Result = "Other (Specify)" Then ActiveDocument.FormFields("Check9").CheckBox.Value = True
If ActiveDocument.FormFields("text66").Result = "Married" Then ActiveDocument.FormFields("Check10").CheckBox.Value = True
If ActiveDocument.FormFields("text66").Result = "Never Married" Then ActiveDocument.FormFields("Check11").CheckBox.Value = True
If ActiveDocument.FormFields("text66").Result = "Widowed" Then ActiveDocument.FormFields("Check12").CheckBox.Value = True
If ActiveDocument.FormFields("text66").Result = "Divorced" Then ActiveDocument.FormFields("Check13").CheckBox.Value = True
If ActiveDocument.FormFields("text66").Result = "Unknown" Then ActiveDocument.FormFields("Check14").CheckBox.Value = True
If ActiveDocument.FormFields("text67").Result = "Yes" Then ActiveDocument.FormFields("Check15").CheckBox.Value = True
If ActiveDocument.FormFields("text67").Result = "No" Then ActiveDocument.FormFields("Check16").CheckBox.Value = True
If ActiveDocument.FormFields("text68").Result = "No" Then ActiveDocument.FormFields("Check17").CheckBox.Value = True
If ActiveDocument.FormFields("text68").Result = "Yes" Then ActiveDocument.FormFields("Check18").CheckBox.Value = True
If ActiveDocument.FormFields("text69").Result = "Resomation" Then ActiveDocument.FormFields("Check19").CheckBox.Value = True
If ActiveDocument.FormFields("text69").Result = "Burial" Then ActiveDocument.FormFields("Check20").CheckBox.Value = True
If ActiveDocument.FormFields("text69").Result = "Cremation" Then ActiveDocument.FormFields("Check21").CheckBox.Value = True
If ActiveDocument.FormFields("text69").Result = "Removal from State" Then ActiveDocument.FormFields("Check22").CheckBox.Value = True
If ActiveDocument.FormFields("text69").Result = "Donation" Then ActiveDocument.FormFields("Check23").CheckBox.Value = True
If ActiveDocument.FormFields("text69").Result = "Other (Specify)" Then ActiveDocument.FormFields("Check24").CheckBox.Value = True
ActiveDocument.FormFields("text64").Result = " "
ActiveDocument.FormFields("text65").Result = " "
ActiveDocument.FormFields("text66").Result = " "
ActiveDocument.FormFields("text67").Result = " "
ActiveDocument.FormFields("text68").Result = " "
ActiveDocument.FormFields("text69").Result = " "
End Sub
Sub ChangeDocProperties()
On Error GoTo ErrHandler
ActiveDocument.BuiltInDocumentProperties("Title") = "DC (Burial)"
Exit Sub
ErrHandler:
If Err <> 0 Then
'Add a document.
Documents.Add
'Clear the error.
Err.Clear
'Execute the code that caused the error.
Resume
End If
End Sub
Sub CountHiddenDocs()
' This macro opens an existing document as hidden
' then makes the hidden document visible.
Dim Doc1 As Document
' Open MyDoc.Doc document as hidden.
Set Doc1 = Documents.Open("<Path>\MyDoc.Doc", Visible:=False)
' Reset the document object variable to make visible the
' hidden document.
'
' NOTE: The following command line will NOT open a
' second instance of the hidden document but instead
' make the currently open, hidden instance of the
' document visible.
Set Doc1 = Documents.Open("<Path>\MyDoc.Doc", Visible:=True)
Doc1.ActiveWindow.Activate
End Sub
[/vba]