Error 5843

D

David

I have just had to re-install Office 2003 and all my files after an HD
failure and replacement. Since then a small macro which prints labels from
addresses in a Word table is coming up with this error " One of the values
passed to this method is out of range". The whole macro is as follows (it is
called from a button on a userform):

Option Explicit

Sub PrintLabel(StrAddr As String, intRow As Integer, intCol As Integer)
Dim bSingleLabel As Boolean

If frmLabel.chkSingleLabel = True Then
bSingleLabel = True
Else
bSingleLabel = False
intRow = 0
intCol = 0
End If

Application.MailingLabel.PrintOut _
Name:="J8160A", _
Address:=StrAddr, _
Singlelabel:=bSingleLabel, _
Row:=intRow, _
Column:=intCol

Unload frmLabel

End Sub

When I hover the cursor over the values being passed, all are OK except that
the 'Name' argument holds "Microsoft Office" and will not pick up the label
type. The macro worked fine until the HD crashed. Any suggestions?

David Stevenson, UK
 
D

Doug Robbins - Word MVP

Is the J8160A label included in the list of labels available in the Label
Options dialog. It is not on my system and if I change the

Name:="J8160A"

to

Name:="J8160"

the error does not occur and a sheet of labels is produced.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

David

Thank you - that was the answer! But why it used to work with J8160A, I
cannot imagine.
 

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