1. Dashboard
  2. Forum
    1. Unerledigte Themen
  3. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team-Mitglieder
    4. Trophäen
    5. Mitgliedersuche
  4. Tutorial Bereich
  • Anmelden
  • Registrieren
  • Suche
Dieses Thema
  • Alles
  • Dieses Thema
  • Dieses Forum
  • Seiten
  • Forum
  • Lexikon
  • Erweiterte Suche
  1. Informatik Forum
  2. Webmaster & Internet
  3. Entwicklung

Outlook Signature + Active Directory + Formatierung

    • Frage
  • Becherer
  • 26. März 2007 um 11:13
  • Unerledigt
  • Becherer
    9
    Becherer
    Mitglied
    Reaktionen
    1
    Punkte
    711
    Beiträge
    121
    • 26. März 2007 um 11:13
    • #1

    Hallo, vielleicht kennt jemand eine schnelle Lösung für mein kleines Problem.

    Ich will die Signatur für Outlook mit Daten aus dem AD erstellen und leicht formatieren.
    Schriftart und Schriftgröße krieg ich hin, aber ich möchte für strDisclaimer die Farbe der Schrift auf Grau stellen. Nur es funktioniert einfach nicht.

    Signature.vbs:
    Danke!

    Code
    On Error Resume Next
    
    
    Set objSysInfo = CreateObject("ADSystemInfo")
    
    
    strUser = objSysInfo.UserName
    Set objUser = GetObject("LDAP://" & strUser)
    
    
    strFullName = objUser.FullName
    words = split(strFullname)
    strName= words(1)
    strSurname=words(0)
    strTitle = objUser.Title
    strDepartment = objUser.Department
    strCompany = objUser.Company
    strPhone = objUser.telephoneNumber
    strCountry = objUser.co
    strZip = objUser.postalCode
    strStreet = objUser.streetAddress
    strFax= objUser.facsimileTelephoneNumber
    strMail=objUser.mail
    strCity = objUser.l
    strSep = "_______________________"
    strHP = objUser.wWWHomepage
    
    
    
    
    
    
    strDisclaimer  = "This message may contain confidential and/or legally privileged information and is intended for use by the indicated addressee only. If you are not the intended addressee: (a) any disclosure, reproduction, distribution or action you take on the basis of the contents of this message (except for this instruction) is strictly prohibited; (b) please notify us immediately by reply e-mail and delete this message from your system."
    
    
    
    
    
    
    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
    
    
    With objSelection.Font
        .Name = "Verdana"
        .Size = 10
    End With
    
    
    objSelection.TypeText strTitle & " " & strName & " " & strSurname
    objSelection.TypeParagraph()
    objSelection.TypeText strDepartment 
    objSelection.TypeParagraph()
    objSelection.TypeText strSep
    
    
    
    
    objSelection.TypeParagraph()
    objSelection.TypeText strCompany
    objSelection.TypeParagraph()
    
    
    With objSelection.Font
        .Name = "Verdana"
        .Size = 8
    End With
    
    
    
    
    With objSelection.Font
        .Name = "Verdana"
        .Size = 10
    End With
    
    
    objSelection.TypeParagraph()
    objSelection.TypeText strStreet & ", " & strZip & " " & strCity & ", " & strCountry
    objSelection.TypeParagraph()
    objSelection.TypeText "T " & strPhone
    objSelection.TypeParagraph()
    ObjSelection.TypeText "F " & strFax
    objSelection.TypeParagraph()
    ObjSelection.TypeText "E " & strMail
    objSelection.TypeParagraph()
    ObjSelection.TypeText "W " & strHP & vbNewLine
    objSelection.TypeParagraph()
    
    
    
    
        With objSelection.Font
            .Name = "Verdana"
            .Size = 8
            .Bold = False
            .Italic = False
            .Underline = wdUnderlineNone
            .UnderlineColor = wdColorBlack
            .StrikeThrough = False
            .DoubleStrikeThrough = False
            .Outline = False
            .Emboss = False
            .Shadow = False
            .Hidden = False
            .SmallCaps = False
            .AllCaps = False
            .Color = wdColorBlueGray
            .Engrave = False
            .Superscript = False
            .Subscript = False
            .Spacing = 0
            .Scaling = 100
            .Position = 0
            .Kerning = 0
            .Animation = wdAnimationNone
        End With
    
    objSelection.TypeText  strDisclaimer
    objSelection.TypeParagraph()
    Set objSelection = objDoc.Range()
    
    
    objSignatureEntries.Add "Signature", objSelection
    objSignatureObject.NewMessageSignature = "Signature"
    objSignatureObject.ReplyMessageSignature = "Signature"
    
    
    objDoc.Saved = true
    objWord.Quit
    Alles anzeigen


  • Becherer
    9
    Becherer
    Mitglied
    Reaktionen
    1
    Punkte
    711
    Beiträge
    121
    • 28. März 2007 um 09:32
    • #2

    Gelöst:

    Code
    Set objDoc = objword.Documents.Add("", False, 1, True)


    und

    Code
    .Color = &h808080


  • Maximilian Rupp 27. Dezember 2024 um 12:05

    Hat das Thema aus dem Forum Programmieren nach Entwicklung verschoben.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!

Benutzerkonto erstellen Anmelden

Rechtliches

Impressum

Datenschutzerklärung