Calling details from Active Directory and changing what is displayed

Author Message
sparkymarcopolo

  • Total Posts : 3
  • Scores: 0
  • Reward points : 0
  • Joined: 1/17/2012
  • Status: offline
Calling details from Active Directory and changing what is displayed Tuesday, January 17, 2012 1:00 AM (permalink)
0
Hi all,
First post here, so hello. I had a look around and couldn't find what I was looking for, hopefully someone can assist.
I'm using a vBscript to pull information from AD and insert into an Outlook Signature, which works fine.
 
What I want to do is change some of the information before it's planted. I'm using this command to insert my Direct Dial
 
if (strPhone) Then objSelection.TypeText "DD: " & strPhone & Chr(11) which displays for example
 
01111 111111 and I need it to change it to +44 111 111111
 
I've had a play around with the' if left', etc but can't get it to change anything
 
Could anyone help?
 
Many thanks
 
Mark
 
 
 
 
 
 
#1
    59cobalt

    • Total Posts : 969
    • Scores: 91
    • Reward points : 0
    • Joined: 7/17/2011
    • Status: offline
    Re:Calling details from Active Directory and changing what is displayed Tuesday, January 17, 2012 9:46 AM (permalink)
    0
    Once you posted your code: perhaps.
     
    #2
      sparkymarcopolo

      • Total Posts : 3
      • Scores: 0
      • Reward points : 0
      • Joined: 1/17/2012
      • Status: offline
      Re:Calling details from Active Directory and changing what is displayed Tuesday, January 17, 2012 10:13 PM (permalink)
      0
      Here you go.
       
      On Error Resume Next
      Set objSysInfo = CreateObject("ADSystemInfo")
      Set WshShell = CreateObject("WScript.Shell")
      strUser = objSysInfo.UserNameSet objUser = GetObject("LDAP://" & strUser)
      'map Active Directory objUser to str names'strName = objUser.FullNamestrTitle = objUser.TitlestrPhone = objUser.TelephoneNumberstrMobile = objUser.MobilestrEmail = objUser.mail
      'Use Word (required) to create the format'Set objWord = CreateObject("Word.Application")
      Set objDoc = objWord.Documents.Add()Set objSelection = objWord.SelectionobjSelection.Style = "No Spacing"
      Set objEmailOptions = objWord.EmailOptionsSet objSignatureObject = objEmailOptions.EmailSignature
      Set objSignatureEntries = objSignatureObject.EmailSignatureEntries
      'If you get problems with line spacing, use vbNewline instead of Chr(11)'
      'Select what is displayed in the Signature based upon the str to ObjUser mappings above'objSelection.Font.Bold = True objSelection.Font.Name = "Arial"objSelection.Font.Size = 11if (strCred) Then objSelection.TypeText strName & ", " & strCred Else objSelection.TypeText strName & Chr(11)objSelection.Font.Bold = FalseobjSelection.TypeText strTitle & Chr(11)objSelection.TypeText "DD: " & strPhone & Chr(11)
      if (strMobile) Then objSelection.TypeText "Mobile: " & strMobile & Chr(11)
      objSelection.TypeParagraph()objSelection.TypeParagraph()
      'add the entire range of what you want displayed and set the font'Set objSelection = objDoc.Range()objSelection.Font.Name = "Arial"
      'Add a siganture entry, name it and assign to new message'objSignatureEntries.Add "Full Signature", objSelectionobjSignatureObject.NewMessageSignature = "Full Signature"
      'Save the content and exit'objDoc.Saved = TrueobjWord.Quit
       
      Any help would be appreciated
       
      #3
        59cobalt

        • Total Posts : 969
        • Scores: 91
        • Reward points : 0
        • Joined: 7/17/2011
        • Status: offline
        Re:Calling details from Active Directory and changing what is displayed Tuesday, January 17, 2012 11:44 PM (permalink)
        0
        sparkymarcopolo
        On Error Resume Next
        Remove this line and see what errors you get.
         
        #4
          sparkymarcopolo

          • Total Posts : 3
          • Scores: 0
          • Reward points : 0
          • Joined: 1/17/2012
          • Status: offline
          Re:Calling details from Active Directory and changing what is displayed Wednesday, January 18, 2012 2:01 AM (permalink)
          0
          I'm not getting errors, I wanted to change what was planted in the signature.
          Sorted now.
           
          #5

            Online Bookmarks Sharing: Share/Bookmark

            Jump to:

            Current active users

            There are 0 members and 1 guests.

            Icon Legend and Permission

            • New Messages
            • No New Messages
            • Hot Topic w/ New Messages
            • Hot Topic w/o New Messages
            • Locked w/ New Messages
            • Locked w/o New Messages
            • Read Message
            • Post New Thread
            • Reply to message
            • Post New Poll
            • Submit Vote
            • Post reward post
            • Delete my own posts
            • Delete my own threads
            • Rate post

            2000-2012 ASPPlayground.NET Forum Version 3.9