Open email with VBA, save email to spesified file path after sent

Fauvic

New Member
Joined
Jun 3, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Good day

I hope you are all well and safe.

We request a lot of information from our clients on a regular basis. We usually keep track of all our requests on a request list in Excel.
But updating this request list on a daily basis is both time consuming and frustrating.

I'm therefore busy creating a request list using VBA to assist with this process.

The current code below creates a directory where the requested information needs to be uploaded by the client.
It then opens up a mail in Outlook where the details of the request will be communicated.

Is there a way to save this mail to the created directory once it has been sent?

VBA Code:
       Private Sub bSubmitRequest_Click()

Dim sCreateFolder As String
Dim olApp As Object
Dim olEmail As Object

'Create Company folder if it does not exist
sCreateFolder = Range("D3").Value & "\" & Range("B12").Value
If Len(Dir(sCreateFolder, vbDirectory)) = 0 Then
MkDir sCreateFolder
End If

'Create Section folder if it does not exist
sCreateFolder = sCreateFolder & "\" & Range("C12").Value
If Len(Dir(sCreateFolder, vbDirectory)) = 0 Then
MkDir sCreateFolder
End If

Set olApp = CreateObject("Outlook.Application")
Set olEmail = olApp.CreateItem(olMailItem)

With olEmail
.To = Range("F12").Value
.Subject = Range("B12").Value & " - " & Range("C12").Value
.Display
End With

End Sub


Any assistance will be greatly appreciated.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,214,657
Messages
6,120,764
Members
448,991
Latest member
Hanakoro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top