Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Converting String to object type...


Message #1 by Saleem Qamar <saleem.qamar@v...> on Wed, 14 Mar 2001 16:20:24 -0600
Thanks Marco,

CallByName worked for me.

Saleem

-----Original Message-----
From: Marco Straforini [mailto:marco@c...]
Sent: Wednesday, March 14, 2001 5:04 PM
To: professional vb
Subject: [pro_vb] RE: Converting String to object type...


Saleem,

CallByName allows you to call a method of an object by its name;
to get the object from a name, you can use CreateObject. But be
careful, because CreateObject creates a new instance of the object.
If you are already using objCust in your application, it is not trivial to
get it from its name alone (unless you store its name in an object
collection)

The MSDN documentation of CreateObject and CallByName should be
clear enough, if you have problems send me an email

m.


> -----Original Message-----
> From:	Saleem Qamar [SMTP:saleem.qamar@v...]
> Sent:	Wednesday, March 14, 2001 2:20 PM
> To:	professional vb
> Subject:	[pro_vb] Converting String to object type...
> 
> I obtained a property name from typelib e.g IsModified
> 
> IsModified = False
> Now I have a string Myvalue = "objCust.IsModified"
> How can I now say Debug.print MyValue
> 
> This Prints "objCust.IsModified"
> I want it to print False - In another word how can I convert the string to
> an Object?
> 
> Thanks
> 
> SS


  Return to Index