Share via

Word Submit button

Anonymous
2018-03-20T17:48:52+00:00

I am trying to create a form with a submit button.  My customer does not have outlook and and the way I have the submit button macros set up it makes them have to have outlook.  I think they have gmail.  here is my code:

Private Sub CommandButton1_Click()

Dim OL              As Object

Dim EmailItem       As Object

Dim Doc             As Document

Application.ScreenUpdating = False

Set OL = CreateObject("Outlook.Application")

Set EmailItem = OL.CreateItem(olMailItem)

Set Doc = ActiveDocument

Doc.Save

With EmailItem

    .Subject = "Insert Subject Here"

    .Body = "Please fill out Service Order"

    .To = "******@outlook.com"

    .Importance = olImportanceNormal 'Or olImprotanceHigh Or olImprotanceLow

    .Attachments.Add Doc.FullName

    .Send

End With

Application.ScreenUpdating = True

Set Doc = Nothing

Set OL = Nothing

Set EmailItem = Nothing

End Sub

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2018-03-21T00:50:52+00:00

    You cannot do what you would like to do.  Instead, you will just have to request that the user complete and return the form to you.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments