make this code without add refrence

zezo2021

Member
Local time
Today, 08:30
Joined
Mar 25, 2021
Messages
412
Hello
Can any developer help me convert this code to work without adding a reference to the outlook?
is possible
Code:
                        Dim EmailApp As Outlook.Application
                        Dim Source As String
                        Set EmailApp = New Outlook.Application
                        
                        Dim EmailItem As Outlook.MailItem
                        Set EmailItem = EmailApp.CreateItem(olMailItem)
                        
                        EmailItem.to = Cells(i, 1)
                        
                        EmailItem.CC = "hello@gmail.com"
                        EmailItem.BCC = "hhhh@gmail.com"
                        EmailItem.Subject = "Test Email From Excel VBA"
                        EmailItem.HTMLBody = "Hi," & vbNewLine & vbNewLine & "This is my first email from Excel" & vbNewLine & vbNewLine & "Regards,"
                        Source = ThisWorkbook.FullName
                    
                        EmailItem.Attachments.Add 
                        
                        EmailItem.Display
 
Google latebinding Outlook for more examples. Here is one
 
(y) (y) (y)
late binding
 

Users who are viewing this thread

Back
Top Bottom