View Single Post
 
Old 08-07-2024, 11:08 PM
ShellR ShellR is offline Windows 10 Office 2019
Novice
 
Join Date: Aug 2024
Posts: 17
ShellR is on a distinguished road
Default run-time error 429 Active X component can't create object when trying to send Word form via email

hello everyone.
I am hoping someone can help in finding a solution to this error message I keep getting with running the following code:

Private Sub CommandButton1_Click()
Dim xOutlookObj As Object
Dim xEmail As Object
Dim xDoc As Document
Application.ScreenUpdating = False
Set xOutlookObj = CreateObject("Outlook.Application")
Set xEmail = xOutlookObj.CreateItem(olMailItem)
Set xDoc = ActiveDocument
xDoc.Save

With xEmail
.Subject = "Assessment Form"
.Body = "Please find the assessment form attached. Thank you."
.To = "testemailaddress@gmail.com"
.Importance = olImportanceNormal
.Attachments.Add xDoc.FullName
.Display
End With
Set xDoc = Nothing
Set xEmail = Nothing
Set xOutlookObj = Nothing
Application.ScreenUpdating = True
End Sub

***Note: I don't have outlook on the computer I am using. I do have Mail and other email apps. Is there a way I can at least test my save and submit button by using other email other than outlook?
thank you
Reply With Quote