Provide me steps to run automate outlook signature

Discussion in 'Scripting' started by Simi Brig, Mar 3, 2010.

  1. Simi Brig

    Simi Brig Guest

    Many thanks for great effort!!

    I went through the attached script and same script used to at my domain but its not supposed to worked out.

    Then used for stand alone machine but no contains in the signature.

    I am easy to run but without contains like name, phone nothing as come.

    Could u assist me to how to execute and way to run of this script?


    Many Thanks,
    Simi Brig.



    xizero wrote:

    just add thisobjSelection.Font.name = "Arial"objSelection.Font.
    18-Oct-07

    just add this
    objSelection.Font.name = "Arial"
    objSelection.Font.Size = 12
    objSelection.Font.Bold = True
    in where the text is being typed ... like so

    On Error Resume Next

    Set objSysInfo = CreateObject("ADSystemInfo")

    strUser = objSysInfo.UserName
    Set objUser = GetObject("LDAP://" & strUser)

    strTitle = objUser.Title
    strName = objUser.FullName
    strDepartment = objUser.Department
    strCompany = objUser.Company
    strPhone = objUser.telephoneNumber

    Set objWord = CreateObject("Word.Application")

    Set objDoc = objWord.Documents.Add()
    Set objSelection = objWord.Selection

    Set objEmailOptions = objWord.EmailOptions
    Set objSignatureObject = objEmailOptions.EmailSignature

    Set objSignatureEntries = objSignatureObject.EmailSignatureEntries

    objSelection.Font.name = "Arial"
    objSelection.Font.Size = 12
    objSelection.Font.Bold = True
    objSelection.TypeText strTitle & ", " & strName
    objSelection.TypeParagraph()
    objSelection.Font.Bold = False
    objSelection.TypeText strDepartment
    objSelection.TypeParagraph()
    objSelection.TypeText strCompany
    objSelection.TypeParagraph()
    objSelection.TypeText strPhone
    objSelection.TypeParagraph()



    Set objSelection = objDoc.Range()

    objSignatureEntries.Add "AD Signature", objSelection
    objSignatureObject.NewMessageSignature = "AD Signature"
    objSignatureObject.ReplyMessageSignature = "AD Signature"

    objDoc.Saved = True
    objWord.Quit


    --
    xizero
    ------------------------------------------------------------------------
    xizero's Profile: http://forums.techarena.in/member.php?userid=33203
    View this thread: http://forums.techarena.in/showthread.php?t=733065

    http://forums.techarena.in

    Previous Posts In This Thread:

    Outllok 2003 Signature script
    I came across the script below in an issue of TechNet and have been testing
    it ever since so that I can actually use it. I'm not very familiar with
    scripting, but from playing with the code in this was able to figure out what
    is what. I would like to tweak it to do a couple more things but have not had
    much luck figuring these options out. If possible I???d like to have the e-mail
    address be an actual link that will bring up a new e-mail with the address in
    the ???To:??? field, I???d like to insert a logo and have it link to a website,
    insert another phone number (mobile), show the address (or another filed from
    AD that I could put the address in) and last but not least on the cosmetic
    side I???d like to use a different font style and color.

    Thanks for any help!

    Here the code I have




    On Error Resume Next

    Set objSysInfo = CreateObject("ADSystemInfo")

    strUser = objSysinfo.UserName
    Set objUser = GetObject("LDAP:// "& strUser)

    strName = objUser.FullName
    strTitle = objUser.Title
    strDepartment = objUser.Department
    strCompany = objUser.Company
    strPhone = objUser.TelephoneNumber
    strOffice = objUser.Office
    strMail = objUser.mail

    Set objWord = CreateObject("Word.Application")
    objWord.Visible = false

    Set objDoc = objWord.Documents.Add()
    Set objSelection = objWord.Selection

    Set objEmailOptions = objWord.EmailOptions
    Set objSignatureObject = objEmailOptions.EmailSignature

    Set objSignatureEntries = objSignatureObject.EmailSignatureEntries

    objSelection.TypeText strName
    objSelection.TypeParagraph()
    objSelection.TypeText strTitle
    objSelection.TypeParagraph()
    objSelection.TypeText strDepartment
    objSelection.TypeParagraph()
    objSelection.TypeText strCompany
    objSelection.TypeParagraph()
    objSelection.TypeText strPhone
    objSelection.TypeParagraph()
    objSelection.TypeText strmail

    Set objSelection=objDoc.Range()

    objSignatureEntries.Add "AD Signature", objSelection
    objSignatureObject.NewMessageSignature = "AD Signature"
    objSignatureObject.ReplyMessageSignature = "AD Signature"

    objDoc.Saved = true
    objWord.Quit


    --
    Thanks,
    John

    John,Based on the code below, you're starting to dive into VB for Apps
    John,

    Based on the code below, you're starting to dive into VB for Apps (creating
    a word doc for your signature). I don't have a simple answer for you via
    specific code, but recomened you take a look at the VB Editor (macro editor)
    interface within Word or Outlook (Alt+F11). It's really a lot more than
    just a macro editor. You can open up the object libraries for each app and
    get some good code examples to accomplish what you are looking for.
    Depending one which app you open it within, Word or Outlook, you'd most
    likely need to add the appropriate reference libraries. This can be done
    via the Tools/References menu. Ex., if in Outlook you will need to add
    Word. In OFF2K7, Words likbraries are refered to as "Microsoft Word 12.0
    Object Library".

    If you are looking for a quicker solution, you may also want to check out
    Desktop Authority, www.scriptlogic.com/da. It will automatically leverage
    user inforamtion in AD to provide some great Outlook signature templates.
    Also has a built in editor which allows you to setup the email address as a
    mailto hyperlink as well as adjust font size, type, color...
    http://www.scriptlogic.com/products/DesktopAuthority/walkthrough-da/I-2-Outlook-General.asp

    Best,

    --
    Joseph Majzoub
    Systems Engineer
    ScriptLogic Corporation
    www.scriptlogic.com




    just add thisobjSelection.Font.name = "Arial"objSelection.Font.
    just add this
    objSelection.Font.name = "Arial"
    objSelection.Font.Size = 12
    objSelection.Font.Bold = True
    in where the text is being typed ... like so

    On Error Resume Next

    Set objSysInfo = CreateObject("ADSystemInfo")

    strUser = objSysInfo.UserName
    Set objUser = GetObject("LDAP://" & strUser)

    strTitle = objUser.Title
    strName = objUser.FullName
    strDepartment = objUser.Department
    strCompany = objUser.Company
    strPhone = objUser.telephoneNumber

    Set objWord = CreateObject("Word.Application")

    Set objDoc = objWord.Documents.Add()
    Set objSelection = objWord.Selection

    Set objEmailOptions = objWord.EmailOptions
    Set objSignatureObject = objEmailOptions.EmailSignature

    Set objSignatureEntries = objSignatureObject.EmailSignatureEntries

    objSelection.Font.name = "Arial"
    objSelection.Font.Size = 12
    objSelection.Font.Bold = True
    objSelection.TypeText strTitle & ", " & strName
    objSelection.TypeParagraph()
    objSelection.Font.Bold = False
    objSelection.TypeText strDepartment
    objSelection.TypeParagraph()
    objSelection.TypeText strCompany
    objSelection.TypeParagraph()
    objSelection.TypeText strPhone
    objSelection.TypeParagraph()



    Set objSelection = objDoc.Range()

    objSignatureEntries.Add "AD Signature", objSelection
    objSignatureObject.NewMessageSignature = "AD Signature"
    objSignatureObject.ReplyMessageSignature = "AD Signature"

    objDoc.Saved = True
    objWord.Quit


    --
    xizero
    ------------------------------------------------------------------------
    xizero's Profile: http://forums.techarena.in/member.php?userid=33203
    View this thread: http://forums.techarena.in/showthread.php?t=733065

    http://forums.techarena.in


    Submitted via EggHeadCafe - Software Developer Portal of Choice
    Sending SMTP email from within BizTalk Orchestration
    http://www.eggheadcafe.com/tutorial...f-1716445b26bc/sending-smtp-email-from-w.aspx
     
    Simi Brig, Mar 3, 2010
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.