Active Directory and VBA

  • Thread starter Thread starter Rudy Welvaert
  • Start date Start date
R

Rudy Welvaert

Hello,

does anybody have experience with addressing the Active
Directory using VBA code.

Starting from an Access form, I want to be able to browse
the Active Directory and read the names of the entries to
display them in the form (and eventualy save them in a
table).

Thanks

R.
 
Hi Rudy

What I know about active directory could be written around the edge of a
postage stamp with a blunt pencil.

But surely there are win32 API routines for it?

You can call win32 APIs from VBA, using the Declare statement.

I just googled on: "active directory" vba

and it got tens of thousands of hits - perhaps start there!

HTH,
TC
 
I use the file-system object:

Following code will print all the file names in current directory.

Public Sub ListCurrentDir()
Dim FileSystem As Object
Dim Location As Folder

Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set db = CurrentDb
CurrentLocation = FileSystem.GetAbsolutePathName("D:")
Set Location = FileSystem.GetFolder(CurrentLocation)

Debug.Print CurrentLocation

For Each IFile In Location.Files
Debug.Print IFile.Name
Next

End Sub

IMPORTANT: I think you have to activate the reference "Scripting"
 
by the way, if you are in C:, I think it should be:

CurrentLocation = FileSystem.GetAbsolutePathName("C:")
 
Thanks Bill,

realy appreciate, but what I realy meant was code to read
the Active Directory Service Interface ...
 
Back
Top