Email via VBA in Excel

ING Hammer

New Member
Joined
Apr 12, 2024
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hello,

so I want the following thing to add to this (I am very new to VBA and learning this since last friday):

- Send Mail from a specific Mail adress (emailItem.To does not work here)
- Have a Signature automatically drafted e.g. when I click the Checkmark the Mail Editor opens but my signature is missing although I have a signature set.
- When somebody else clicks on the checkbox, their signature should be seen instead of mine (if they have one)

Do I have to use html? This question popped up because my signature contains urls.

VBA Code:
Sub CheckBox_Date_stamp()

Dim xChk As CheckBox

Set xChk = ActiveSheet.CheckBoxes(Application.Caller)
Set emailApplication = CreateObject("Outlook.Application")
Set emailItem = emailApplication.CreateItem(0)

With xChk.TopLeftCell.Offset(, 1)
    If xChk.Value = xlOff Then
        .Value = ""
    Else
       .Value = Date
    End If
    
    With xChk.TopLeftCell.Offset(, 2)
    If xChk.Value = xlOff Then
        .Value = "No"
    Else
       .Value = "Yes"
        emailItem.Display
        emailItem.to = "Test@Test.com"
        emailItem.Subject = "Text1"
        emailItem.Body = "Text2" & vbCrLf & vbCrLf & "Text3" & vbCrLf & vbCrLf & vbCrLf & "Text4"
    End If
    
End With
End With
End Sub
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,223,937
Messages
6,175,510
Members
452,650
Latest member
Tinfish

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