Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript error

Status
Not open for further replies.

welshone

Programmer
Jul 30, 2001
414
GB
hello,

I am passing a select box from asp to some vbscript, so far I have this :

' Create a new document.
oApp.MailingLabel.CreateNewDocument "document.forms.form1.MyType.options[document.forms.form1.MyType.options.selectedIndex].value", "", _
"MyLabelLayout", , 4 ' 4 = wdPrinterManualFeed


when I run it I get the following error :

one of the values passed to this method or property is out of range

any thoughts ?

cheers,
Jamie
 
Because you have document.forms.form1.etc.... in double quotes - you are passing that string to the CreateNewDocument method.

Remove the double quotes. SOmething like:

oApp.MailingLabel.CreateNewDocument document.forms.form1.MyType.options[document.forms.form1.MyType.options.selectedIndex].value, "", _
"MyLabelLayout", , 4 Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top