Hi,

I'm working with IMAPI2 objects. The way my script works is not important.
The specific problem I have is that one method returns an object, but this
is not recognized as an usable object by VBS. I've this line that returns an
object:

Set objStream = objImage.ImageStream

objStream is an IStream object with its own methods, but trying to invoke
one of its methods, generates a runtime error: "Object Required
'objStream'". I found the following:

IsObject(objStream) returns FALSE
VarType(objStream) returns 13 (not 9 as expected for an object)
TypeName(objStream) returns "Unknown"

Is there any way to use the methods provided by this type 13 object in VBS ?

Thanks a lot.

Notice: I already posted this question on "MSDN Forums/Software Development
for Windows Vista/Optical Platform Discussion", but later I found out that
is not a problem of the IMAPI, while a generic VBS problem, so I decided to
post this message here. Please don't consider as a cross posting.

--
Massimo

Re: How to use VarType = 13 objects by Paul

Paul
Wed Jan 30 12:09:41 CST 2008


<mpiceni@newsgroup.nospam> wrote in message
news:OuuI0w0YIHA.4756@TK2MSFTNGP02.phx.gbl...
> Hi,
>
> I'm working with IMAPI2 objects. The way my script works is not
> important. The specific problem I have is that one method returns an
> object, but this is not recognized as an usable object by VBS. I've
> this line that returns an object:
>
> Set objStream = objImage.ImageStream
>
> objStream is an IStream object with its own methods, but trying to
> invoke one of its methods, generates a runtime error: "Object
> Required 'objStream'". I found the following:
>
> IsObject(objStream) returns FALSE
> VarType(objStream) returns 13 (not 9 as expected for an object)
> TypeName(objStream) returns "Unknown"
>
> Is there any way to use the methods provided by this type 13 object
> in VBS ?
>
> Thanks a lot.
>
> Notice: I already posted this question on "MSDN Forums/Software
> Development for Windows Vista/Optical Platform Discussion", but
> later I found out that is not a problem of the IMAPI, while a
> generic VBS problem, so I decided to post this message here. Please
> don't consider as a cross posting.

Hi, Massimo

Two things:
1. Just because something is an object, does not mean that it is a
scriptable object, or that all of its properties, methods and events
are scriptable. Have you searched MSDN (or the source of your IMAPI
object), for documentation that might talk about the object's
scriptability?

2. Limited cross posting is a good thing. I think you multi-posted.
Multi-posting is not so good, although unavoidable if the first place
you post to is not a good choice.

http://www.blakjak.demon.co.uk/mul_crss.htm

-Paul Randall