By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,644 Members | 1,866 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,644 IT Pros & Developers. It's quick & easy.

Active Directory Usage in VBA

NeoPa
Expert Mod 15k+
P: 31,258
Having come across this from ADezii's code in having access send an email, email automation, I felt this was something I'd benefit from progressing with.

I have determined that the CreateObject() function appears to be from basic VBA, though I'm not sure where I would find information as to which string values could be used as the [Application.]Class parameter.

I'm interested in finding where the roots may be found for such AD related objects, and where the Meta-data for them may be found.
Expand|Select|Wrap|Line Numbers
  1. Dim objAD As Object
  2. Dim objUser As Object
  3.  
  4. Set objAD = CreateObject("ADSystemInfo")
  5. Set objUser = GetObject("LDAP://" & objAD.UserName)
Jun 19 '09 #1
Share this Question
Share on Google+
2 Replies


ADezii
Expert 5K+
P: 8,607
@NeoPa
Hello NeoPa, isn't it just as simple as Opening the Object Browser, selecting the appropriate Library, see what Classes are contained within the Library, select a Class, then see what Properties/Methods an Instance of the Class (Object) would expose? In the specific case you mention, the ActiveDs Library contains the ADSystemInfo Class. UserName would be a Property exposed by an Instance of this Class, namely: ActiveDs.ADSystemInfo.UserName. Am I off track here in my thinking?
Jun 20 '09 #2

NeoPa
Expert Mod 15k+
P: 31,258
As with most things it depends heavily on having a starting point.

Personally I'm not unfamiliar with the object browser, but I wouldn't have known where to start looking for the appropriate library had you not introduced it in your post.

It has also been my experience that finding what you need in a library often depends on what you already know about it. I was told about the TimeOut property recently which I'd searched high & low for before. It was not a parameter to the .Execute method as I would have expected (I believe it was you who pointed me in the right direction eventually).

In short, you'r pretty well on the button, but if there is one element where you may be a little awry it is in assuming everything is straightforward, even for those who don't already know the answers.
Jun 22 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.