R
Ronald
We use Word VBA on a daily basis to program solutions for clients. We
encounter Word bugs on a regular basis and usually we try to work around
them. Mainly because we don't know how to get Microsoft to fix them. I hope
this is the right place to post them, if not, I hope someone can point me in
the right direction.
The bugs are sometimes version independent and sometimes not. We try to make
our software backwards compatible, which is getting harder and harder.
BUG 1:
- open this Word document: http://www.n-tree.nl/bugs/b01.doc , in Word
97/2000/XP.
- select exactly the text '[testje]' (8 karakters) in the top box, this a
table in a frame.
- Open the VBA editor
- Open the direct dialog
- Execute: Selection.Range.Text=""
- The selected text should disappear, but it does not, the last two
characters are not deleted.
- In the other boxes (normal frame and normal table) it does work.
- In Word 2003 it works in all cases.
- Workarounds, like directly placing text in the selection with
Selection.Typetext "hallo" or Selection.Range.Delete in the other boxes, have
side effects in some Office versions. Range.Delete for instance deletes an
extra space, try placing two spaces after the ']' and you'll see one of it
will disappears, but it shouldn't.
Note: This bug is the same for bookmarks in the boxes, if you replace the
text in the bookmarks, the last two characters are also left behind.
BUG 2:
- When you try to open an document in the background, in the code behind an
open form, Word 2003 generates an error, other Word versions do not.
- Executed code behind a form: 'Documents.Open strFile' gives error:
Err.Number: 5479
Err.Description: You can not quit Word, because a Dialog Box is Active.
Switch to Microsoft Word first to close the Dialog Box.
- The VBA code does not close Word, so the error is not needed!
I hope anyone can confirm these bugs and hopefully solve them?
Thanks.
encounter Word bugs on a regular basis and usually we try to work around
them. Mainly because we don't know how to get Microsoft to fix them. I hope
this is the right place to post them, if not, I hope someone can point me in
the right direction.
The bugs are sometimes version independent and sometimes not. We try to make
our software backwards compatible, which is getting harder and harder.
BUG 1:
- open this Word document: http://www.n-tree.nl/bugs/b01.doc , in Word
97/2000/XP.
- select exactly the text '[testje]' (8 karakters) in the top box, this a
table in a frame.
- Open the VBA editor
- Open the direct dialog
- Execute: Selection.Range.Text=""
- The selected text should disappear, but it does not, the last two
characters are not deleted.
- In the other boxes (normal frame and normal table) it does work.
- In Word 2003 it works in all cases.
- Workarounds, like directly placing text in the selection with
Selection.Typetext "hallo" or Selection.Range.Delete in the other boxes, have
side effects in some Office versions. Range.Delete for instance deletes an
extra space, try placing two spaces after the ']' and you'll see one of it
will disappears, but it shouldn't.
Note: This bug is the same for bookmarks in the boxes, if you replace the
text in the bookmarks, the last two characters are also left behind.
BUG 2:
- When you try to open an document in the background, in the code behind an
open form, Word 2003 generates an error, other Word versions do not.
- Executed code behind a form: 'Documents.Open strFile' gives error:
Err.Number: 5479
Err.Description: You can not quit Word, because a Dialog Box is Active.
Switch to Microsoft Word first to close the Dialog Box.
- The VBA code does not close Word, so the error is not needed!
I hope anyone can confirm these bugs and hopefully solve them?
Thanks.