SYMPTOMS
When you attempt to set the Line Width for a border using Microsoft Visual
Basic for Applications commands, you receive one of the following errors:
Run-time error '5843': One of the values passed to this method or
property is out of range.
Run-time error '4120': Bad Parameter
WORKAROUND
When applying borders using Visual Basic For Applications commands, you
can specify the line style and the line width of the border to be
applied. Each border line style has a different number of varying line
widths that can be applied to a border. That is, all line widths are not
available to use with every line style.
Also, the list of wdLineWidth constants are available for use in a macro
regardless of the line style being applied. There is no programmatic
method available for determining whether a particular line width is a
valid width to use with a chosen border line style. If you apply an
invalid line width to a line style and then compile and run your macro,
an error occurs.
For more information about detting line widths, click the Office Assistant
while in the Visual Basic Editor, type
LineWidth, click Search, and then
click to view "LineWidth Property."
NOTE: If the Assistant is hidden, click the Office Assistant button on the
Standard toolbar. If the Assistant is not able to answer your query, please
see the following article in the Microsoft Knowledge Base:
176476 OFF: Office Assistant Not Answering Visual Basic Questions
REFERENCES
For more information about getting help with Visual Basic for Applications,
please see the following article in the Microsoft Knowledge Base:
163435 VBA: Programming Resources for Visual Basic for Applications