Visual Basic crashing Word 2003

Y

YvonneW

Question

I have created a number of checklists with visual basic code which enables
text to become unhidden when a checkbox is checked.

The document was created in Compatibility mode in Office 2007 and saved as
an Office 97-2003 document.

When clicking on a checkbox in Office 2003, Word crashes. This does not
consistently happen. One day it crashes, the next it is fine. The code is:

Private Sub ShowArea(ByRef aCheckBox As MSForms.CheckBox, ByVal sBookmark As
String)
Dim bProteced As Boolean
Dim iSection As Integer
bProtected = (ActiveDocument.ProtectionType <> wdNoProtection)
If bProtected Then ActiveDocument.Unprotect
ActiveDocument.Bookmarks.ShowHidden = True
ActiveWindow.View.ShowHiddenText = True
iSection =
ActiveDocument.Bookmarks(sBookmark).Range.Information(wdActiveEndSectionNumber)
ActiveWindow.View.ShowHiddenText = False
ActiveDocument.Bookmarks.ShowHidden = False
ActiveDocument.Sections.Item(iSection).Range.Font.Hidden = Not
aCheckBox.Value
If bProtected Then ActiveDocument.Protect wdAllowOnlyFormFields, True
End Sub
Private Sub CheckBox1_Click()
ShowArea CheckBox1, "_Commencement"
End Sub
 
D

db

what I would first
try is to copy that
code you wrote in
2007

and paste it in the
2003 word as a
2003 visual basic
project.

then compile it and
debug it.


--

db·´¯`·...¸><)))º>
DatabaseBen, Retired Professional
- Systems Analyst
- Database Developer
- Accountancy
- Veteran of the Armed Forces
- Microsoft Partner
- @hotmail.com
~~~~~~~~~~"share the nirvana" - dbZen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top