Outlook Contacts

From Fxp Wiki

Jump to: navigation, search
Make existing contacts (items) use another form.
Faire en sorte que des contacts existant d'un dossier contact, utilisent un nouveau formulaire (formulaire personnalisé)

Omsgclas.doc

The first solution, using a word document with a macro, can be ineffective because of rights or security restrictions. The version of Outlook and msword can also cause the failure of the system.
La première solution consiste à utiliser un document word téléchargeable sur le site de microsoft, et qui contient une macro capable de changer la valeur de la "message class" de chaque contact. Malheureusement, dûe à des limitations de droits et de sécurité, cette solution peut rencontre un échec.

Script


Image:WarningIcon.png Warning
The best and simplest way is to use a macro
La meilleure solution et la plus simple est d'utiliser une macro
The second solution gained me a success when the first method didn't work.
La seconde solution s'est révélée valide, lorsque la première avait échouée.
  1. open the file with the contacts you want to change
    Ouvrez le dossier contenant les contacts à changer
  2. Open a contact.
    Ouvrez un contact
  3. Go in Tools > Forms > modify this form
    Allez dans Outils > Formulaires > Modifier ce formulaire
  4. One of the last button on the bar is "view code". Click on it.
    Cliquez sur l'un des derniers bouton de la barre "code"
  5. Paste the following code in it
    Collez dans la fenêtre le code ci dessous
  6. Change the name of your customized form in the second line of the code
    Changez dans la second ligne du code le nom du formulaire que vous voulez attribuer au contact
  7. Close the script code, you don't have to save it
    Fermez la fenêtre de script, inutile de sauvegarder
  8. publish the form by direct button "publish" (it goes in the normal Outlook folder)
    Publier le formulaire à l'aide du bouton publier
  9. publish it a second time through Tools > Forms >publish as and choose the specific folder of your Contacts
    Republier le formulaire dans les autres dossier opportun en allant dans Outils > Formulaire > Publier en tant que.
  10. close the form, at the window asking if you want to save the datas, you can answer no
    Fermer le formulaire, à la question voulez-vous enregistrer, vous pouvez répondre non
  11. open one of the contact again
    Ouvrez le contact
  12. if everything is ok, it should display a waiting bar, and then, a message telling you the work is done
    Si tout c'est bien passez, une barre d'attente apparait, puis un message "done", qui veut dire terminé, "c'est fait"
  13. let the contact open
    Laissez le contact ouvert
  14. go to Tool > Forms > Modify this form, click the see the code button, erase everything
    allez dans Outils > formulaire > modifier ce formulaire et cliquez sur le bouton de source code pour tout enlever
  15. Close this code window
    refermez cette fenêtre
  16. republish the form in all the directories you had published it
    Republier le formulaire dans les différents répertoires


Code:

 
Sub Item_Open
 
   ' Change the following line to your new Message Class
   NewMC = "IPM.Contact.MyNewForm"
 
   Set CurFolder = Application.ActiveExplorer.CurrentFolder
   Set AllItems = CurFolder.Items
   NumItems = CurFolder.Items.Count
 
   ' Loop through all of the items in the folder
   For I = 1 to NumItems
 
      Set CurItem = AllItems.Item(I)
 
      ' Test to see if the Message Class needs to be changed
      If CurItem.MessageClass <> NewMC Then
 
         ' Change the Message Class
         CurItem.MessageClass = NewMC
 
         ' Save the changed item
         CurItem.Save
 
      End If
 
   Next
 
   MsgBox "Done."
 
End Sub
		
 

Source

Personal tools