![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Returning a DN in VBA Hi How can I return a Users DN (distinghised Name) that is stored in Active Directory using VBA in Microsoft Office Word 2003. Regards D |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Returning a DN in VBA In what form is it stored? -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< ><<> <>>< <>><<> DMc2007 wrote: Quote: > Hi > > How can I return a Users DN (distinghised Name) that is stored in > Active Directory using VBA in Microsoft Office Word 2003. > > Regards > > D |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Returning a DN in VBA basically it is part of Active Directory, when you log on to a windows domain, it is used to identify who the user is and what OU or Organizational Unit that person belongs to. "Graham Mayor" <gmayor@xxxxxx> wrote in message news:ud$oYfghJHA.4868@xxxxxx Quote: > In what form is it stored? > > -- > <>>< ><<> ><<> <>>< ><<> <>>< <>><<> > Graham Mayor - Word MVP > > My web site www.gmayor.com > Word MVP web site http://word.mvps.org > <>>< ><<> ><<> <>>< ><<> <>>< <>><<> > > > DMc2007 wrote: Quote: >> Hi >> >> How can I return a Users DN (distinghised Name) that is stored in >> Active Directory using VBA in Microsoft Office Word 2003. >> >> Regards >> >> D > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Returning a DN in VBA "DMc2007" <davidmcnaughton_1999@xxxxxx> wrote in message news:B095CD47-EDCB-4C31-8064-64AFD3A427D7@xxxxxx Quote: > Hi > > How can I return a Users DN (distinghised Name) that is stored in Active > Directory using VBA in Microsoft Office Word 2003. > > Regards > > D attribute of the object is the DN of the current user: ===== Set objSysInfo = CreateObject("ADSystemInfo") strUserDN = objSysInfo.UserName ======== An error is raised if the user is not authenticated to a domain. In VB you must add a reference to "Active DS Type Library" (which is activeds.tlb). I've never done this in VBA. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Returning a DN in VBA Richard Mueller [MVP] wrote: Quote: > "DMc2007" <davidmcnaughton_1999@xxxxxx> wrote in message > news:B095CD47-EDCB-4C31-8064-64AFD3A427D7@xxxxxx Quote: >> Hi >> >> How can I return a Users DN (distinghised Name) that is stored in >> Active Directory using VBA in Microsoft Office Word 2003. >> >> Regards >> >> D > The standard method is to use the ADSystemInfo object. The UserName > attribute of the object is the DN of the current user: > ===== > Set objSysInfo = CreateObject("ADSystemInfo") > strUserDN = objSysInfo.UserName > ======== > An error is raised if the user is not authenticated to a domain. In > VB you must add a reference to "Active DS Type Library" (which is > activeds.tlb). I've never done this in VBA. > > -- > Richard Mueller > MVP Directory Services > Hilltop Lab - http://www.rlmueller.net library, you can use early binding, which gives you IntelliSense support. Sub x() Dim objSysInfo As ADSystemInfo Dim strUserDN As String Set objSysInfo = New ADSystemInfo strUserDN = objSysInfo.UserName MsgBox strUserDN End Sub -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| function not returning anything | PowerShell | |||
| Function returning a value | VB Script | |||
| returning to a search | Vista file management | |||
| Returning from RC2 to RC1 | Vista General | |||
| Returning to XP, problem with spanned set | Vista installation & setup | |||