Word 2003 crashing, table, formfield, makro.

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!
 
W

Word Heretic

G'day <[email protected]>,

Which line is highlighted when you hit Debug upon the crash?

Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)
 
G

Guest

Hello,
none! If I trace through it, all works. But: after END
(macro is done), Word chrashes, and wants to report a bug
in Word.
The Problem is deeper inside word, not in macro. I need a
workaround for that.
Word 2003 crashes if the formfield is in a table, you
klick on it, exit it, an a macro get's .range.information
(x) about it.
Try it!
Does it not crash?
 
J

Jay Freedman

I've done exactly as you described, and it does not crash -- it works
as expected. (That was after fixing the syntax error of having an
equal sign after the keyword MsgBox.)

If your copy of Word crashes every time, something is wrong with (a)
the document, (b) your Normal.dot template, or (c) your Word
installation. Try these steps in turn until the problem disappears:

(a) Try to remove any corruption in the document (see
http://word.mvps.org/FAQs/AppErrors/CorruptDoc.htm), or throw it away
and start with a fresh blank document.

(b) Rename Normal.dot and restart Word to make it build a new one. If
you have customizations in the old template that you want, use the
Organizer to copy them over to the new one.

(c) Try Help > Detect and Repair. If that doesn't do it, try
reinstalling Word.
 
G

Guest

Did you put the formfields in the table?
Can I send you my "faulty" word document?
I'll try your advises now.
Thanks.
 
G

Guest

I tried all your advises.
Nothing worked.
Newest word update installed.
Nothing helped.
:((
 

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