Crashing Word 2000

A

Anne Schouten

Who can help me????



I use Word 2000.



In the file are many tables.

After entering a number in certain cells with a text field I want to have a
valuta sign in de cell left of it.

If the cell is empty then the cell left of it must be empty too.

Therefore I made a macro and linked that to the text field.



The problem is that the macro often causes Word to shut-down. Mainly while
moving from an empty cell to an other cell.



I also tested the macro in Word 2003. Then there is no problem at all.



Moreover I would like to switch Screenupdating off and on, but then Word
looses its inserting point. In the newsgroups I found the advice to use
Ranges instead of Selection, but how do I use ranges for filling a cell with
text in the active table.



the code I made is as follows:



Dim aDoc As Document

If Selection.Information(wdWithInTable) = True Then
If aDoc.ProtectionType <> wdNoProtection Then
aDoc.Unprotect
End If
With Selection
.SelectCell
If IsNumeric(Left(.Text, Len(.Text) - 2)) Then
.MoveLeft Unit:=wdCell, Count:=1, Extend:=wdMove
.Text = "?"
Else
.MoveLeft Unit:=wdCell, Count:=1, Extend:=wdMove
.Delete
End If
End With
Else
MsgBox "Not in table"
End If
If aDoc.ProtectionType = wdNoProtection Then
aDoc.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End If
 

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