Corps d'email depuis un fichier texte en VB ?
Résolu/Fermé
manautop
Messages postés
138
Date d'inscription
lundi 27 novembre 2006
Statut
Membre
Dernière intervention
24 janvier 2013
-
Modifié par manautop le 23/01/2012 à 18:12
manautop Messages postés 138 Date d'inscription lundi 27 novembre 2006 Statut Membre Dernière intervention 24 janvier 2013 - 25 janv. 2012 à 15:20
manautop Messages postés 138 Date d'inscription lundi 27 novembre 2006 Statut Membre Dernière intervention 24 janvier 2013 - 25 janv. 2012 à 15:20
A voir également:
- Corps d'email depuis un fichier texte en VB ?
- Fichier rar - Guide
- Comment réduire la taille d'un fichier - Guide
- Comment ouvrir un fichier epub ? - Guide
- Ouvrir un fichier .bin - Guide
- Comment ouvrir un fichier docx ? - Guide
1 réponse
manautop
Messages postés
138
Date d'inscription
lundi 27 novembre 2006
Statut
Membre
Dernière intervention
24 janvier 2013
3
25 janv. 2012 à 15:20
25 janv. 2012 à 15:20
voici la solution
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TypeOfPromoCombo.ResetText()
OfferTypeComboBox.ResetText()
CountryMarketComboBox.ResetText()
CompanyPartnerComboBox.ResetText()
ComChannelComboBox.ResetText()
EnrollementTextBox.ResetText()
NumberNightTextBox.ResetText()
RevenueTextBox.ResetText()
RecruitmentextBox.ResetText()
CostTextBox.ResetText()
CostpointTextBox.ResetText()
CommentRichTextBox.ResetText()
RequestTextBox.ResetText()
End Sub
Private Sub EnvoiMail()
' ___________________________________________________________________________________________
' envoi d'email
Dim OutlookApp As New Microsoft.Office.Interop.Outlook.Application
Dim NewMail As Microsoft.Office.Interop.Outlook.MailItem
Dim NIFO As String
If RadioButton1.Checked Then
NIFO = "Network Involved"
Else
NIFO = "Flagship Opening"
End If
Dim a = "Type Of Promotion : " & TypeOfPromoCombo.Text & Chr(13)
Dim b = "Start Date Promotion : " & StartDateTimePicker.Text & Chr(13)
Dim c = "End Date Promotion : " & EndDateTimePicker.Text & Chr(13)
Dim d = "End Date Bonus 1st Stay : " & EndBonusDateTimePicker.Text & Chr(13)
Dim e = "Offer Type : " & OfferTypeComboBox.Text & Chr(13)
Dim f = "Country / Market : " & CountryMarketComboBox.Text & Chr(13)
Dim g = " " & NIFO & Chr(13)
Dim h = "Company / Partner : " & CompanyPartnerComboBox.Text & Chr(13)
Dim i = "Communication Channel : " & ComChannelComboBox.Text & Chr(13)
Dim j = "Number of Enrollment : " & Val(EnrollementTextBox.Text) & Chr(13)
Dim k = "Number of Nights : " & Val(NumberNightTextBox.Text) & Chr(13)
Dim l = "Revenue Generated : " & Val(RevenueTextBox.Text) & Chr(13)
Dim m = "Recruitement : " & Val(RecruitmentextBox.Text) & Chr(13)
Dim n = "Cost Estimation (EUR) : " & Val(CostTextBox.Text) & Chr(13)
Dim o = "Cost Estimation (POINTS) : " & Val(CostpointTextBox.Text) & Chr(13)
Dim p = "Comments : " & Val(CommentRichTextBox.Text) & Chr(13)
Dim q = "Request made by : " & RequestTextBox.Text & Chr(13)
'changement automatique
If CompanyPartnerComboBox.Text = "Air Berlin -Top Bonus" Then 'Si numérique
CostpointTextBox.Text = (CostTextBox.Text * 0.013)
Else 'Sinon on vide le contenu
CostTextBox.Text = ""
CostpointTextBox.Text = ""
End If
NewMail = OutlookApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem)
NewMail.Recipients.Add("jonathan.sebban@accor.com")
NewMail.Subject = "Demande de code Promo"
NewMail.Body = q & a & b & c & d & e & f & g & h & i & j & k & l & m & n & o & p
NewMail.Send()
End Sub
Private Sub ButtonSendIt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSendIt.Click
Call EnvoiMail()
End Sub
End Class
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TypeOfPromoCombo.ResetText()
OfferTypeComboBox.ResetText()
CountryMarketComboBox.ResetText()
CompanyPartnerComboBox.ResetText()
ComChannelComboBox.ResetText()
EnrollementTextBox.ResetText()
NumberNightTextBox.ResetText()
RevenueTextBox.ResetText()
RecruitmentextBox.ResetText()
CostTextBox.ResetText()
CostpointTextBox.ResetText()
CommentRichTextBox.ResetText()
RequestTextBox.ResetText()
End Sub
Private Sub EnvoiMail()
' ___________________________________________________________________________________________
' envoi d'email
Dim OutlookApp As New Microsoft.Office.Interop.Outlook.Application
Dim NewMail As Microsoft.Office.Interop.Outlook.MailItem
Dim NIFO As String
If RadioButton1.Checked Then
NIFO = "Network Involved"
Else
NIFO = "Flagship Opening"
End If
Dim a = "Type Of Promotion : " & TypeOfPromoCombo.Text & Chr(13)
Dim b = "Start Date Promotion : " & StartDateTimePicker.Text & Chr(13)
Dim c = "End Date Promotion : " & EndDateTimePicker.Text & Chr(13)
Dim d = "End Date Bonus 1st Stay : " & EndBonusDateTimePicker.Text & Chr(13)
Dim e = "Offer Type : " & OfferTypeComboBox.Text & Chr(13)
Dim f = "Country / Market : " & CountryMarketComboBox.Text & Chr(13)
Dim g = " " & NIFO & Chr(13)
Dim h = "Company / Partner : " & CompanyPartnerComboBox.Text & Chr(13)
Dim i = "Communication Channel : " & ComChannelComboBox.Text & Chr(13)
Dim j = "Number of Enrollment : " & Val(EnrollementTextBox.Text) & Chr(13)
Dim k = "Number of Nights : " & Val(NumberNightTextBox.Text) & Chr(13)
Dim l = "Revenue Generated : " & Val(RevenueTextBox.Text) & Chr(13)
Dim m = "Recruitement : " & Val(RecruitmentextBox.Text) & Chr(13)
Dim n = "Cost Estimation (EUR) : " & Val(CostTextBox.Text) & Chr(13)
Dim o = "Cost Estimation (POINTS) : " & Val(CostpointTextBox.Text) & Chr(13)
Dim p = "Comments : " & Val(CommentRichTextBox.Text) & Chr(13)
Dim q = "Request made by : " & RequestTextBox.Text & Chr(13)
'changement automatique
If CompanyPartnerComboBox.Text = "Air Berlin -Top Bonus" Then 'Si numérique
CostpointTextBox.Text = (CostTextBox.Text * 0.013)
Else 'Sinon on vide le contenu
CostTextBox.Text = ""
CostpointTextBox.Text = ""
End If
NewMail = OutlookApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem)
NewMail.Recipients.Add("jonathan.sebban@accor.com")
NewMail.Subject = "Demande de code Promo"
NewMail.Body = q & a & b & c & d & e & f & g & h & i & j & k & l & m & n & o & p
NewMail.Send()
End Sub
Private Sub ButtonSendIt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSendIt.Click
Call EnvoiMail()
End Sub
End Class