View Single Post
 
Old 09-10-2018, 02:36 AM
stu_c stu_c is offline Windows 8 Office 2013
Novice
 
Join Date: Dec 2013
Posts: 20
stu_c is on a distinguished road
Default

Hello mate
How would you make a submit button in a ribbon tab? I have never done one before

Quote:
Originally Posted by gmayor View Post
Personally I would add a ribbon tab to the document to hold the submit button, however the following will disable and change the caption on the submit button.



Code:
Private Sub SubmitButton1_Click()
'Label1.Visible = True
Dim OL              As Object
Dim EmailItem       As Object
Dim Doc             As Document
 
Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(0)
Set Doc = ActiveDocument
SubmitButton1.Enabled = False
SubmitButton1.Caption = "Form submitted"
Doc.Save
 
With EmailItem
    .Subject = "Form submitted"
    .Body = ""
    .To = "none@none.com"
    .Importance = 1
    .Attachments.Add Doc.FullName
    .Send
End With
 
Application.ScreenUpdating = True
 
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
End Sub
Reply With Quote