Hello mate
How would you make a submit button in a ribbon tab? I have never done one before
Quote:
Originally Posted by gmayor
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
|