Passer au contenu principal

Comment répondre automatiquement au format HTML dans Outlook?

Dans Microsoft Outlook, nous pouvons configurer les paramètres et composer tous les nouveaux messages au format HTML, mais nous ne pouvons pas répondre automatiquement aux messages au format HTMT, car il répond toujours au format initial des messages reçus. Cet article vous présentera des astuces pour répondre automatiquement au format HTML dans Outlook.

Répondre manuellement au format HTML avec mise en forme
Répondre automatiquement au format HTML avec VBA
Répondez toujours automatiquement au format HTML avec Kutools for Outlook


Répondre manuellement au format HTML avec mise en forme

Il est facile de convertir les formats de texte brut ou de texte enrichi au format HTML lorsque vous répondez à un message électronique dans Outlook.

1: Sélectionnez le message électronique auquel vous répondrez plus tard.

2: Cliquez sur le Répondre bouton sur la Accueil (ou sur la barre d'outils dans Outlook 2007) pour répondre au message électronique sélectionné.

3: Cliquez sur le HTML sur le Format du texte onglet (ou Options onglet dans Outlook 2007).

Ensuite, le message de réponse est immédiatement converti au format HTML.

4: Composez ce message de réponse et cliquez sur le bouton Envoyer .


Répondre automatiquement au format HTML avec VBA

La méthode suivante vous aidera à répondre automatiquement à tous les messages électroniques au format HTML dans Microsoft Outlook.

1: Sélectionnez l'e-mail auquel vous répondrez au format HTML.

2: Appuyez sur le autre + F11 touches pour ouvrir la fenêtre Microsoft Visual Basic pour Applications.

3: Cliquez sur le insérer > Module.

4: Collez le code suivant dans la nouvelle fenêtre de module.

Sub AlwaysReplyInHTML()
Dim oSelection As Outlook.Selection
Dim oItem As Object
'Get the selected item
Select Case TypeName(Application.ActiveWindow)
Case "Explorer"
Set oSelection = Application.ActiveExplorer.Selection
If oSelection.Count > 0 Then
Set oItem = oSelection.Item(1)
Else
MsgBox "Please select an item first!", vbCritical, "Reply in HTML"
Exit Sub
End If
Case "Inspector"
Set oItem = Application.ActiveInspector.CurrentItem
Case Else
MsgBox "Unsupported Window type." & vbNewLine & "Please select or open an item first.", _
vbCritical, "Reply in HTML"
Exit Sub
End Select
    Dim oMsg As Outlook.MailItem
Dim oMsgReply As Outlook.MailItem
Dim bPlainText As Boolean
'Change the message format and reply
If oItem.Class = olMail Then
Set oMsg = oItem
If oMsg.BodyFormat = olFormatPlain Then
bPlainText = True
End If
oMsg.BodyFormat = olFormatHTML
Set oMsgReply = oMsg.Reply
If bIsPlainText = True Then
oMsg.BodyFormat = olFormatPlain
End If
oMsg.Close (olSave)
oMsgReply.Display
'Selected item isn't a mail item
Else
MsgBox "No message item selected. Please select a message first.", _
vbCritical, "Reply in HTML"
Exit Sub
End If
'Cleanup
Set oMsgReply = Nothing
Set oMsg = Nothing
Set oItem = Nothing
Set oSelection = Nothing
End Sub

5: Si vous souhaitez répondre uniquement à ce message sélectionné au format html, appuyez sur le bouton F5 clé pour exécuter le code. Ensuite, la fenêtre du message de réponse apparaît, veuillez le composer et appuyez sur le bouton Envoyer bouton pour envoyer l'e-mail.

Conseils::
Si vous souhaitez toujours ou fréquemment répondre aux e-mails au format html à l'avenir dans Outlook, veuillez poursuivre la configuration comme suit.
1) Cliquez sur le Personnaliser la barre d'outils Accès rapide bouton dans le ruban Outlook, puis cliquez sur Plus de commandes depuis le menu déroulant.

2) Dans le Options d'Outlook boîte de dialogue, vous devez:
2.1) Sélectionnez Macros dans l' Choisissez les commandes de la liste déroulante;
2.2) Sélectionnez Projet1.ToujoursRépondreEnHTML dans la boîte de commande;
2.3) Cliquez sur le Ajouter bouton (vous pouvez voir que la macro sélectionnée est ajoutée dans la case de droite);
2.4) Cliquez sur le OK bouton. Voir la capture d'écran:

3) La macro est maintenant ajoutée dans la barre d'outils d'accès rapide et affichée sous forme de  icône. Chaque fois que vous devez répondre à un e-mail au format html, veuillez sélectionner l'e-mail et cliquez sur ce bouton pour l'activer.


Répondez toujours automatiquement au format HTML avec Kutools for Outlook

Kutools for Outlook : avec plus de 100 compléments Outlook pratiques, gratuit pour essayer sans limitation dans 60 jours.

Ici, je vous recommande un utilitaire pratique - Formatage des réponses fixe of Kutools for Outlook. Avec cet utilitaire, vous pouvez facilement spécifier un format de réponse tel que HTML, texte brut et RTF, et fixer le formatage spécifié comme format de réponse pour tous les futurs e-mails de réponse.

1. Cliquez Kutools > Formatage fixe > Formatage des réponses fixe > Définir le formatage des réponses. Voir la capture d'écran:

2. dans le Définir le formatage des réponses boîte de dialogue, sélectionnez le HTML option, puis cliquez sur le OK .

3. Cliquez maintenant sur Formatage fixe > Formatage des réponses fixeActiver le formatage des réponses fixes sous l'onglet Kutools pour activer l'utilitaire.

Désormais, Outlook répond toujours à un e-mail au format HTML.

Si vous souhaitez avoir un essai gratuit de cet utilitaire, rendez-vous sur télécharger gratuitement le logiciel d'abord, puis appliquez l'opération selon les étapes ci-dessus.


Meilleurs outils de productivité bureautique

Kutools for Outlook - Plus de 100 fonctionnalités puissantes pour booster votre Outlook

🤖 Assistant de messagerie IA: E-mails professionnels instantanés avec la magie de l'IA : un clic pour des réponses géniales, un ton parfait, une maîtrise multilingue. Transformez l’emailing sans effort ! ...

📧 Email Automation: Absent du bureau (disponible pour POP et IMAP)  /  Programmer l'envoi d'e-mails  /  Auto CC/BCC par règles lors de l'envoi d'un e-mail  /  Transfert automatique (règles avancées)   /  Ajouter un message d'accueil automatique   /  Divisez automatiquement les e-mails multi-destinataires en messages individuels 

(I.e. Email Management: Rappel facile des e-mails  /  Bloquer les e-mails frauduleux par sujets et autres  /  Supprimer les e-mails en double  /  Recherche Avancée  /  Consolider les dossiers 

(I.e. Pièces jointes ProSauvegarde par lots  /  Détachement par lots  /  Compression par lots  /  Enregistrement automatique   /  Détachement automatique  /  Compression automatique 

???? Magie de l'interface: 😊Plus d'émojis jolis et cool   /  Boostez votre productivité Outlook avec des vues à onglets  /  Réduire Outlook au lieu de fermer 

???? Merveilles en un clic: Répondre à tous avec les pièces jointes entrantes  /   E-mails anti-hameçonnage  /  🕘Afficher le fuseau horaire de l'expéditeur 

👩🏼‍🤝‍👩🏻 Contacts et calendrier: Ajouter par lots des contacts à partir des e-mails sélectionnés  /  Diviser un groupe de contacts en groupes individuels  /  Supprimer les rappels d'anniversaire 

infos Caractéristiques 100 Attendez votre exploration ! Cliquez ici pour en savoir plus.

 

 

Comments (25)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I've been using this macro for a couple years now. Unfortunately it has started to change the character set of the replied email to some unknown character set eg"整瑸栯浴㭬挠慨獲瑥甽晴㠭㸢਍䴼呅⁁䅎䕍∽敇" that is not translatable. Has anyone else come across this issue and if so were you able to find a fix?
This comment was minimized by the moderator on the site
Hi there,

Please try the code below:
Sub AlwaysReplyInHTML()
Dim xSelection As Outlook.Selection
Dim xItem As Object
Dim xMail As Outlook.MailItem
Dim xMailReply As Outlook.MailItem
'On Error Resume Next
Select Case TypeName(Application.ActiveWindow)
  Case "Explorer"
    Set xSelection = Application.ActiveExplorer.Selection
    If xSelection.Count > 0 Then
      Set xItem = xSelection.Item(1)
    Else
      MsgBox "Please select an item first!", vbCritical, "Kutools for Outlook"
      Exit Sub
    End If
  Case "Inspector"
    Set xItem = Application.ActiveInspector.CurrentItem
  Case Else
    MsgBox "Unsupported Window type." & vbNewLine & "Please select or open an item first.", vbCritical, "Kutools for Outlook"
    Exit Sub
End Select
If xItem.Class = olMail Then
  Set xMail = xItem
  Set xMailReply = xMail.Reply
  xMailReply.Display
  xMailReply.BodyFormat = olFormatHTML
Else
  MsgBox "No message item selected. Please select a message first.", vbCritical, "Kutools for Outlook"
  Exit Sub
End If
Set xMailReply = Nothing
Set xMail = Nothing
Set xItem = Nothing
Set xSelection = Nothing
End Sub
This comment was minimized by the moderator on the site
Merci beaucoup.
Je l’ai modifié un peu, et ça fonctionne de nouveau chez moi, sans la transformation en Chinois…

Sub AlwaysReplyInHTML_Kutools()
Dim xSelection As Outlook.Selection
Dim xItem As Object
Dim xMail As Outlook.MailItem
Dim xMailReply As Outlook.MailItem

'On Error Resume Next
Select Case TypeName(Application.ActiveWindow)
  Case "Explorer"
    Set xSelection = Application.ActiveExplorer.Selection
    If xSelection.Count > 0 Then
      Set xItem = xSelection.Item(1)
    Else
      MsgBox "Please select an item first!", vbCritical, "Kutools for Outlook"
      Exit Sub
    End If
  Case "Inspector"
    Set xItem = Application.ActiveInspector.CurrentItem
  Case Else
    MsgBox "Unsupported Window type." & vbNewLine & "Please select or open an item first.", vbCritical, "Kutools for Outlook"
    Exit Sub
End Select

If xItem.Class = olMail Then
  Set xMail = xItem
  'Changer le format ici, afin que la réponse inclu notre signature en html…!
        xMail.BodyFormat = olFormatHTML
  
  Set xMailReply = xMail.Reply
  xMailReply.Display
  'xMailReply.BodyFormat = olFormatHTML
Else
  MsgBox "No message item selected. Please select a message first.", vbCritical, "Kutools for Outlook"
  Exit Sub
End If

Set xMailReply = Nothing
Set xMail = Nothing
Set xItem = Nothing
Set xSelection = Nothing
End Sub
This comment was minimized by the moderator on the site
Thanks I'll give that a go. Have a nice day.
This comment was minimized by the moderator on the site
Hi,

as for answering everyone - it's very simple - just change the 31st line of code:

Set oMsgReply = oMsg.Reply --> change "oMsg.ReplyAll" or change "oMsg.Forward"

And to apply for "all emails" just do this:
Instead of creating buttons in quick access, create new buttons directly in the ribbon (Customize Ribbon), create a "Custom" ("New Group") there and create buttons from macros (first macro to "reply to all", second macro to "forward").

And the original "Reply" group can be removed from the ribbon ;)

Anyway, extendoffice.com is a great site from which I sometimes draw data - many thanks... ;)
This comment was minimized by the moderator on the site
This is great and solves a long term frustration with outlook! As someone not experienced with VBA coding could I get a little more advice on how to set up the replyall and forward functionality. I have the 'replyinHTML' working (with a custom ribbon button for it) but am not sure how the get the other options working. Should I be creating a new project or new module within the existing project with the modified code at line 31?
Any help appreciated - thanks!
This comment was minimized by the moderator on the site
Hi, you should save them respectively as three different modules. :)
This comment was minimized by the moderator on the site
Thank you!
This comment was minimized by the moderator on the site
Hello,

This works very well, thanks. But... it does not reply to all. Only the sender of the email received is added to the reply. What should I change in the code so it does "Reply to all" instead of "Reply"?


Thanks!
This comment was minimized by the moderator on the site
Running the macro works for one instance, but how to replicate it to occur on every instance?
This comment was minimized by the moderator on the site
I followed all of the steps listed about but when I press F5 to run the Module I get an error message saying that the Macros for this project have been disabled. I even tried going into Outlooks settings and telling Outlook to enable all Macros. Any help would be greatly appreciated!
This comment was minimized by the moderator on the site
Thanks a lot for this macro!
This comment was minimized by the moderator on the site
this only changes the email i have selected. how do you change it for all emails?
This comment was minimized by the moderator on the site
Same thing for me. Did you get any help?
This comment was minimized by the moderator on the site
Please, do you know the appropriate 'Alt F11' and 'F5' keys when using Outlook 2016 on a Mac?
This sure is an annoying omission by Microsoft. Many thanks. Hope you can help.
This comment was minimized by the moderator on the site
Thanks, it worked. You are da man!
This comment was minimized by the moderator on the site
Thank you for this, but i am having issues. I copy/pasted and the number were put above the text when i pasted it and I got the error message - "compile error: invalid outside procedure" Then i tried to just erase the numbers and leave the test and got : Run time Error - could not send message. - I then clicked Debug and got the same error as others: Set oMsgReply = oMsg.Reply Thoughts?
This comment was minimized by the moderator on the site
Dont open the email, only highlight it in outlook. Alt +F11 insert the module F5 New email should open as HTML to reply
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations