G
Guest
Hello,
my macro crashs Word 2003. In Word 97 and 2000 it does not!
The Macro normaly counts the lines in a formfield.
If the formfield is in a table word 2003 crashs.
if the formfield is outside every thing is ok.
To simulate the error do please this:
File new->
add a table->
add 2 formfields for textinput.
name the first Text_1, onexit start macro "CheckText_1"
name the second Text_2, onexit start macro "CheckText_2".
The macros are those:
-------------------------------------------------
Private Sub Check(What)
With ActiveDocument.FormFields("Text_" & What)
Lines = 1 + _
(.Range.Characters.Last.Information
(wdVerticalPositionRelativeToPage) _
- .Range.Information
(wdVerticalPositionRelativeToPage)) / 14
xL = Lines - Fix(Lines)
If xL < 0.5 Then
Lines = Fix(Lines)
Else
Lines = Fix(Lines) + 1
End If
End With
MsgBox = Str(Lines)
End Sub
Sub CheckText_1()
Call Check("1")
End Sub
Sub CheckText_2()
Call Check("2")
End Sub
----------------------------------------------------------
Now protect the document for formfield-editing only.
Jump with mouse from one field to the other.
-> Word 2003 crashs.
If I use Tab, or move the formfields out of a table it
works!
Is there a workaorund?
Help!
my macro crashs Word 2003. In Word 97 and 2000 it does not!
The Macro normaly counts the lines in a formfield.
If the formfield is in a table word 2003 crashs.
if the formfield is outside every thing is ok.
To simulate the error do please this:
File new->
add a table->
add 2 formfields for textinput.
name the first Text_1, onexit start macro "CheckText_1"
name the second Text_2, onexit start macro "CheckText_2".
The macros are those:
-------------------------------------------------
Private Sub Check(What)
With ActiveDocument.FormFields("Text_" & What)
Lines = 1 + _
(.Range.Characters.Last.Information
(wdVerticalPositionRelativeToPage) _
- .Range.Information
(wdVerticalPositionRelativeToPage)) / 14
xL = Lines - Fix(Lines)
If xL < 0.5 Then
Lines = Fix(Lines)
Else
Lines = Fix(Lines) + 1
End If
End With
MsgBox = Str(Lines)
End Sub
Sub CheckText_1()
Call Check("1")
End Sub
Sub CheckText_2()
Call Check("2")
End Sub
----------------------------------------------------------
Now protect the document for formfield-editing only.
Jump with mouse from one field to the other.
-> Word 2003 crashs.
If I use Tab, or move the formfields out of a table it
works!
Is there a workaorund?
Help!