PDA

Click to See Complete Forum and Search --> : Handling Arrays in ASP


subbupr
Mar 12th, 2001, 02:12 PM
Hi Folks,

My problem goes like this. I would like to check
grammar/synonyms and run a spell check on a text
field in an asp page. This, i am doing by creating
an instance of WORD.APPLICATION and accesing
its objects/members.

Consider the following script :

dim li
dim a
dim m
set w=createobject("Word.application")
set doc=w.documents.add
li= w.SynonymInfo("BIG").SynonymList(1)

Synonymlist returns an array of strings. But when
i try to access the array like,

msgbox li(1)

it gives my a 'type mismatch' error. I'v tried out
all sorts of possibilities but still this is still bugging
me.

U must also consider that this script is working
perfectly if it is executed thru a component.
Only when u access it through asp script does
it give u an error.

Help me out folks...!!!!

vbuser1976
Mar 13th, 2001, 08:22 AM
I am not really sure, but maybe you need to include a .inc file on the asp page. Like when you are working with ado, you need to include the vbscript file.
<%include file = "adovbs.inc"%>
I hope this helps you. Hopefully, someone else in this forum has a better answer than I can give you.

Good Luck.

Mar 13th, 2001, 08:46 AM
If the error occur on this line msgbox li(1) perhaps you can try this.

msgbox CStr(li(1))