IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VBScript Discussion :

Creation de signature Outlook


Sujet :

VBScript

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Inscrit en
    Avril 2006
    Messages
    36
    Détails du profil
    Informations forums :
    Inscription : Avril 2006
    Messages : 36
    Par défaut Creation de signature Outlook
    Bonjour,

    J'utilise ce script VBS pour créer une signature dans Outlook à l'ouverture de session

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
     
    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
     
    Set objWord = CreateObject("Word.Application")
    objWord.Visible = TRUE
    Set objDoc = objWord.Documents.Add()
    Set objSelection = objWord.Selection
    objSelection.Style = "No Spacing"
     
    Set objEmailOptions = objWord.EmailOptions
    Set objSignatureObject = objEmailOptions.EmailSignature
    Set objSignatureEntries = objSignatureObject.EmailSignatureEntries
     
    'Name of Staff
    objSelection.Font.Name = "Calibri"
    objSelection.Font.Bold = True
    objSelection.Font.Size = "12"
    objSelection.Font.Color = RGB(15,36,62)
    objSelection.TypeText strName
    objSelection.TypeText(Chr(11))
     
    'Role of Staff
    objSelection.Font.Name = "Calibri"
    objSelection.Font.Bold = False
    objSelection.Font.Size = "11"
    objSelection.Font.Color = 0
    objSelection.TypeText strTitle
    objSelection.TypeText(Chr(11))
     
     
    objSelection.TypeParagraph()
     
    'Company Contact details
    objSelection.Font.Color = RGB(38,38,38)
    objSelection.TypeText "Tel +44 (0) 744 525 5214"
    objSelection.TypeText(Chr(11))
    objSelection.TypeText "Fax +44 (0) 744 524 2244"
    objSelection.TypeText(Chr(11))
    objSelection.Font.Color = RGB(23,54,93)
     
    objSelection.TypeParagraph()
     
     
    'environment message
    objSelection.Font.Name = "Webdings"
    objSelection.Font.Size = "14"
    objSelection.Font.Color = RGB(115,155,63)
    objSelection.TypeText "P "
    objSelection.Font.Name = "Calibri"
    objSelection.Font.Size = "9"
    objSelection.TypeText "Please consider the environment before printing this e-mail."
     
    Set objSelection = objDoc.Range()
    objDoc.SaveAs "F:\tests.doc"
    'MsgBox "ok"
     
    objSignatureEntries.Add "test5", objSelection
    objSignatureObject.NewMessageSignature = "test5"
    objSignatureObject.ReplyMessageSignature = "test5"
     
    objDoc.Saved = True
     
    'objDoc.SaveAs "F:\tests2.doc"
    objWord.Quit
    il fonctionne trais bien si la ligne 15 et à TRUE et ne me rajoute pas la signature s'il est à FALSE
    quelqu'un à une idée merci
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    objWord.Visible = TRUE

  2. #2
    Membre averti
    Inscrit en
    Avril 2006
    Messages
    36
    Détails du profil
    Informations forums :
    Inscription : Avril 2006
    Messages : 36
    Par défaut pour info.
    CreateObject(Word.Application) needs delay with Office2010/Win7

    http://social.msdn.microsoft.com/For...-9843ba9207f7/

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. signature outlook 2007 via html
    Par kaiser59 dans le forum Outlook
    Réponses: 8
    Dernier message: 05/10/2009, 00h07
  2. Réponses: 3
    Dernier message: 08/06/2009, 11h36
  3. creation de tache outlook
    Par bleuerouge dans le forum Services Web
    Réponses: 1
    Dernier message: 07/03/2007, 09h09
  4. Excel VBA récupérer la signature Outlook
    Par dorschner dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 10/12/2006, 16h19

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo