Leo_Polla_Psemata
Registered User.
- Local time
- Today, 07:32
- Joined
- Mar 24, 2014
- Messages
- 364
Hi there
The below code is the simplified version, the full version is much more complicated with many iifs, however it works just fine, no need to bother you.
Then, after email is displayed on screen and user is about to click send, we click another button, <<Private sub Opexcel1()>>
which creates and outlines an excel consisted of 3 colons and 12 lines, i copy this excel part and paste it on the email body.
Then we send the email with this excel form on its body.
This is an application for special rates, we need approval by specific department(s), management, different each time based on the nature
of the request however the format is always the same.
The question is.
Could I just click one sub , the <<Private Sub EmailOut_Click()>> in our case , and combine the <<Private sub Opexcel1()>>
so in my email i find on the body, the text and the excel form? No need to click another btn and copy paste ?
The below code is the simplified version, the full version is much more complicated with many iifs, however it works just fine, no need to bother you.
Then, after email is displayed on screen and user is about to click send, we click another button, <<Private sub Opexcel1()>>
which creates and outlines an excel consisted of 3 colons and 12 lines, i copy this excel part and paste it on the email body.
Then we send the email with this excel form on its body.
This is an application for special rates, we need approval by specific department(s), management, different each time based on the nature
of the request however the format is always the same.
The question is.
Could I just click one sub , the <<Private Sub EmailOut_Click()>> in our case , and combine the <<Private sub Opexcel1()>>
so in my email i find on the body, the text and the excel form? No need to click another btn and copy paste ?
Code:
Private Sub EmailOut_Click()
Dim Msg1 As String
Msg1 = "Dear XXXX" & ", <p>" & "Please review and approve this one" & ", <p>"
Dim O As Outlook.Application
Dim M As Outlook.MailItem
Set O = New Outlook.Application
Set M = O.CreateItem(olMailItem)
With M
.BodyFormat = olFormatHTML
.HTMLBody = Msg1 & ", <p>"
' ****** Below body first lines, i want to display an excel form consisted of 12 lines , 3 coloun, i
.To = "tsa@gmail.com"
.CC = "esp@gmail.com"
.Subject = "DRQ" & MyRequest & ".Rate approval request -" & CustN & " - CPF ID: " & CPFID & " - Validity:" & "From:" & ValidFrom & " Up to: " & ValidTo & & "//" & Volume
.Display
End With
Set M = Nothing
Set O = Nothing
End Sub