Freelance Project Requests Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net


Datei 1:



ActiveX COM Control in Net Framework 4 for Office applications

With the Email_Send4 component you can send emails directly from Microsoft Access, Word or Excel without having to press a confirmation from Outlook.


Here is an example in MS Acess 2016


References to .tlb

The email_send component must be integrated into vba (Alt-F11) under Menu-> Tools-> References with Browse to the local path of the file Email_Send4.tlb




Download, required files

For the Email_Send component you need the file Email_Send4.dll. These can be downloaded here and saved on a local path.

In addition, the registerbat and unregister.bat files are available for logging in as ActiveX Control in the computer so that the component can also be viewed in Access and Excel.



Macro code

The following is an example of the vba macro code that is used to send mail in Microsoft Access.

The function also works in MS Excel, Word and Powerpoint

Option Compare Database

Option Explicit On


Private Sub btnSend_Click()

    '---------------< btnSend_Click() >----------------


    '---------------</ btnSend_Click() >----------------

End Sub



Private Sub fx_Email_Senden()

    '-------------< fx_Email_Senden() >-------------

    '--< Email einstellen >--

    Dim objEmail As Email_Send4.Email_Send4

    Set objEmail = New Email_Send4.Email_Send4


    Dim sAddress_TO As String, sSubject As String, sText As String

    Dim sAddress_FROM As String, sPassword As String, SMTP_Address As String, sPort As String, Enable_SSL As Boolean

    sAddress_FROM = tbxEmail_From

    sPassword = tbxPassword

    SMTP_Address = tbxDomain


    sAddress_TO = tbxEmail_To

    Enable_SSL = True

    sPort = tbxPort

    sSubject = tbx_Subject

    sText = tbxText


    '< SEND >

    '*send with Email_Send4.dll Control

    objEmail.Send_Email sAddress_TO, "", sAddress_FROM, sPassword, SMTP_Address, sPort, Enable_SSL, sSubject, sText

    '</ SEND >


    '--< Email einstellen >--


    '< Abschluss >

    Set objEmail = Nothing

    '</ Abschluss >


    MsgBox "send"

    '----</ mit Outlook senden >----

    '-------------</ fx_Email_Senden() >-------------

End Sub






In order for the Email_Send4.dll to be recognized as ActiveX COM Control in Microsoft Office, the file Register.bat has to be executed as an administrator.



In the Register.bat, the .NET registry is run with regasm.exe. You have to adjust the following path where the current component should be installed.


C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe "C:\_Daten\Desktop\Demo\Access\2017-10-27 Email_Send4\Email_Send4.dll" /tlb /codebase





To uninstall, you must also run Unregister.bat as an administrator.

The file path to the current Email_Send4.dll must also be adjusted here

C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe /u "C:\_Daten\Desktop\Demo\Access\2017-10-27 Email_Send4\Email_Send4.dll"



PDF Text Reader for Excel Word Access
ActiveX Barcode 39 Control for Excel Access Word
Project template for an ActiveX control
Email Send Control for Office applications
COM: Run-time error 2147024894 80070002 automation error The system can not find the specified file
COM Error: DllRegisterServer entry point Error message when registering an ActiveX COM DLL
Code: Create your own ActiveX Component in Visual Studio 2017 and Office 2016 365
MS Office Access: Sending emails directly from the Office application without Outlook


Contact for Jobs, Project Requests: