Ceci est une page optimisée pour les mobiles. Cliquez sur ce texte pour afficher la vraie page.

Microsoft 365 Mise en forme email

romubzh35

XLDnaute Occasionnel
Bonjour
je souhaite savoir comment modifier ce code pour avoir une mise en page plus sympa car pour le moment c'est basique.
savoir comment mettre en couleur et gras
et mon top10 en bas peut etre sous forme de tableau ?
merci et bonne fin de journée

VB:
Sub EnvoiMail()

  Dim MonOutlook As Object
  Dim MonMessage As Object
  Dim corps As String
 
  Set MonOutlook = CreateObject("Outlook.Application")
  Set MonMessage = MonOutlook.createitem(0)
  MonMessage.to = ThisWorkbook.Sheets("Plan de convergence des stocks").Range("Q4").Value
  MonMessage.Subject = "Convergence des stocks : Mail automatique"
    corps = "Bonjour , ci dessous les valeurs en date du " & UserForm1.TextBox19.Value & " provenant du fichier de convergence des stocks à " & UserForm1.TextBox21.Value & " : " & Chr(10)
    corps = corps & Chr(13) & Chr(10)
    corps = corps & "TRANSIT : " & Chr(10) & UserForm1.TextBox1.Value & " K€ soit " & UserForm1.TextBox6.Value & " jour(s)" & Chr(10) & Chr(10)
    corps = corps & "RAW MATERIALS : " & Chr(10) & UserForm1.TextBox2.Value & " K€ soit " & UserForm1.TextBox7.Value & " jour(s)" & Chr(10) & Chr(10)
    corps = corps & "WIP : " & Chr(10) & UserForm1.TextBox3.Value & " K€ soit " & UserForm1.TextBox8.Value & " jour(s)" & Chr(10) & Chr(10)
    corps = corps & "FG : " & Chr(10) & UserForm1.TextBox4.Value & " K€ soit " & UserForm1.TextBox9.Value & " jour(s)" & Chr(10) & Chr(10)
    corps = corps & "TOTAL : " & Chr(10) & UserForm1.TextBox5.Value & " K€ soit " & UserForm1.TextBox10.Value & " jour(s)" & Chr(10) & Chr(10)
    corps = corps & "LISTING DES REFS AVEC MOINS DE 2 JOURS DE STOCKS : " & Chr(10)
    
    corps = corps & "1 : " & UserForm1.TextBox32.Value & " : " & UserForm1.TextBox42.Value & " jour(s)" & Chr(10)
    corps = corps & "2 : " & UserForm1.TextBox33.Value & " : " & UserForm1.TextBox43.Value & " jour(s)" & Chr(10)
    corps = corps & "3 : " & UserForm1.TextBox34.Value & " : " & UserForm1.TextBox44.Value & " jour(s)" & Chr(10)
    corps = corps & "4 : " & UserForm1.TextBox35.Value & " : " & UserForm1.TextBox45.Value & " jour(s)" & Chr(10)
    corps = corps & "5 : " & UserForm1.TextBox36.Value & " : " & UserForm1.TextBox46.Value & " jour(s)" & Chr(10)
    corps = corps & "6 : " & UserForm1.TextBox37.Value & " : " & UserForm1.TextBox47.Value & " jour(s)" & Chr(10)
    corps = corps & "7 : " & UserForm1.TextBox38.Value & " : " & UserForm1.TextBox48.Value & " jour(s)" & Chr(10)
    corps = corps & "8 : " & UserForm1.TextBox39.Value & " : " & UserForm1.TextBox49.Value & " jour(s)" & Chr(10)
    corps = corps & "9 : " & UserForm1.TextBox40.Value & " : " & UserForm1.TextBox50.Value & " jour(s)" & Chr(10)
    corps = corps & "10 : " & UserForm1.TextBox41.Value & " : " & UserForm1.TextBox51.Value & " jour(s)" & Chr(10) & Chr(10)
    corps = corps & "Ce message a été envoyé par l'utilisateur " & UserForm1.TextBox16.Value & ", "
    corps = corps & "Bonne journée."
  MonMessage.Body = corps
  'MonMessage.send
    MonMessage.display
     
  Set MonOutlook = Nothing
End Sub
 

dysorthographie

XLDnaute Accro
Bonjour,
VB:
corps = "<P>Bonjour , ci dessous les valeurs en date du " & UserForm1.TextBox19.Value & " provenant du fichier de convergence des stocks à "  & UserForm1.TextBox21.Value & " : </P>"
 corps = corps & "<UL>"
 corps = corps & "  <LI>TRANSIT : </LI>"
 corps = corps & "  <UL>"
 corps = corps & "    <LI>" & UserForm1.TextBox1.Value & " K€ soit " & UserForm1.TextBox6.Value & " "
 corps = corps & "jour(s)</LI></UL>"
 corps = corps & "  <LI>RAW MATERIALS : </LI>"
 corps = corps & "  <UL>"
 corps = corps & "    <LI>" & UserForm1.TextBox2.Value & " K€ soit " & UserForm1.TextBox7.Value & " "
 corps = corps & "jour(s)</LI></UL>"
 corps = corps & "  <LI>WIP :</LI>"
 corps = corps & "  <UL>"
 corps = corps & "    <LI>" & UserForm1.TextBox3.Value & " K€ soit " & UserForm1.TextBox8.Value & " "
 corps = corps & "jour(s)</LI></UL>"
 corps = corps & "  <LI>FG : </LI>"
 corps = corps & "  <UL>"
 corps = corps & "    <LI>" & UserForm1.TextBox4.Value & " K€ soit " & UserForm1.TextBox9.Value & " "
 corps = corps & "jour(s)</LI></UL>"
 corps = corps & "  <LI>TOTAL : </LI>"
 corps = corps & "  <UL>"
 corps = corps & "    <LI>" & UserForm1.TextBox5.Value & " K€ soit " & UserForm1.TextBox10.Value & " "
 corps = corps & "  jour(s)</LI></UL></UL>"
 corps = corps & "<OL>"
 corps = corps & "  <LI>LISTING DES REFS AVEC MOINS DE 2 JOURS DE STOCKS :&nbsp;</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox32.Value & " : " & UserForm1.TextBox42.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox33.Value & " : " & UserForm1.TextBox43.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox34.Value & " : " & UserForm1.TextBox44.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox35.Value & " : " & UserForm1.TextBox45.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox36.Value & " : " & UserForm1.TextBox46.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox37.Value & " : " & UserForm1.TextBox47.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox38.Value & " : " & UserForm1.TextBox48.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox39.Value & " : " & UserForm1.TextBox49.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox40.Value & " : " & UserForm1.TextBox50.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox41.Value & " : " & UserForm1.TextBox51.Value & " jour(s)</LI></OL>"
 corps = corps & "<P>Ce message a été envoyé par l'utilisateur " & UserForm1.TextBox16.Value & ", Bonne "
 corps = corps & "journée.</P>"
MonMessage.HtmlBody = corps
 
Dernière édition:

romubzh35

XLDnaute Occasionnel
bonjour
ca me donne ca
les mots les uns à la suite des autres
 

dysorthographie

XLDnaute Accro
VB:
Sub EnvoiMail()

  Dim MonOutlook As Object
  Dim MonMessage As Object
  Dim corps As String
 
  Set MonOutlook = CreateObject("Outlook.Application")
  Set MonMessage = MonOutlook.createitem(0)
  MonMessage.to = ThisWorkbook.Sheets("Plan de convergence des stocks").Range("Q4").Value
  MonMessage.Subject = "Convergence des stocks : Mail automatique"
    
 corps = "<P>Bonjour , ci dessous les valeurs en date du " & UserForm1.TextBox19.Value & " provenant du fichier de convergence des stocks à "  & UserForm1.TextBox21.Value & " : </P>"
 corps = corps & "<UL>"
 corps = corps & "  <LI>TRANSIT : </LI>"
 corps = corps & "  <UL>"
 corps = corps & "    <LI>" & UserForm1.TextBox1.Value & " K€ soit " & UserForm1.TextBox6.Value & " "
 corps = corps & "jour(s)</LI></UL>"
 corps = corps & "  <LI>RAW MATERIALS : </LI>"
 corps = corps & "  <UL>"
 corps = corps & "    <LI>" & UserForm1.TextBox2.Value & " K€ soit " & UserForm1.TextBox7.Value & " "
 corps = corps & "jour(s)</LI></UL>"
 corps = corps & "  <LI>WIP :</LI>"
 corps = corps & "  <UL>"
 corps = corps & "    <LI>" & UserForm1.TextBox3.Value & " K€ soit " & UserForm1.TextBox8.Value & " "
 corps = corps & "jour(s)</LI></UL>"
 corps = corps & "  <LI>FG : </LI>"
 corps = corps & "  <UL>"
 corps = corps & "    <LI>" & UserForm1.TextBox4.Value & " K€ soit " & UserForm1.TextBox9.Value & " "
 corps = corps & "jour(s)</LI></UL>"
 corps = corps & "  <LI>TOTAL : </LI>"
 corps = corps & "  <UL>"
 corps = corps & "    <LI>" & UserForm1.TextBox5.Value & " K€ soit " & UserForm1.TextBox10.Value & " "
 corps = corps & "  jour(s)</LI></UL></UL>"
 corps = corps & "<OL>"
 corps = corps & "  <LI>LISTING DES REFS AVEC MOINS DE 2 JOURS DE STOCKS :&nbsp;</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox32.Value & " : " & UserForm1.TextBox42.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox33.Value & " : " & UserForm1.TextBox43.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox34.Value & " : " & UserForm1.TextBox44.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox35.Value & " : " & UserForm1.TextBox45.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox36.Value & " : " & UserForm1.TextBox46.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox37.Value & " : " & UserForm1.TextBox47.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox38.Value & " : " & UserForm1.TextBox48.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox39.Value & " : " & UserForm1.TextBox49.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox40.Value & " : " & UserForm1.TextBox50.Value & " jour(s)</LI>"
 corps = corps & "  <LI>" & UserForm1.TextBox41.Value & " : " & UserForm1.TextBox51.Value & " jour(s)</LI></OL>"
 corps = corps & "<P>Ce message a été envoyé par l'utilisateur " & UserForm1.TextBox16.Value & ", Bonne "
 corps = corps & "journée.</P>"
MonMessage.HtmlBody = corps
  'MonMessage.send
    MonMessage.display
    
  Set MonOutlook = Nothing
End Sub
 
Les cookies sont requis pour utiliser ce site. Vous devez les accepter pour continuer à utiliser le site. En savoir plus…