junglej815
12-23-2008, 11:03 AM
Hello, Looking for some info/help. I am going to try and be as clear as I can with what I'm looking for.
What I currently have:
I have a word document with text boxes, checkboxes, and what not. A command button that acts as a "submit" button that when clicked on opens a new mail message in outlook with the word document attached. The "To" email address and "Subject" line are filled in automatically as well. The code for that is as follows:
Public 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 = "Content Conference Room Request"
.Body = "" & vbCrLf & _
"" & vbCrLf & _
""
.To = "facilitiesservicescenter@blank.com"
.Importance = olImportanceNormal 'Or olImprotanceHigh Or olImprotanceLow
.Attachments.Add Doc.FullName
.Display
End With
Application.ScreenUpdating = True
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
End Sub
What I'm looking to do if possible:
Is there a way to have the text that is entered in Textbox3 on the document be inserted into the subject line as well automatically when the "Submit button is clicked on? And how if so.
Thanks for any help.
Edit Lucas: VBA tags added to code.
What I currently have:
I have a word document with text boxes, checkboxes, and what not. A command button that acts as a "submit" button that when clicked on opens a new mail message in outlook with the word document attached. The "To" email address and "Subject" line are filled in automatically as well. The code for that is as follows:
Public 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 = "Content Conference Room Request"
.Body = "" & vbCrLf & _
"" & vbCrLf & _
""
.To = "facilitiesservicescenter@blank.com"
.Importance = olImportanceNormal 'Or olImprotanceHigh Or olImprotanceLow
.Attachments.Add Doc.FullName
.Display
End With
Application.ScreenUpdating = True
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
End Sub
What I'm looking to do if possible:
Is there a way to have the text that is entered in Textbox3 on the document be inserted into the subject line as well automatically when the "Submit button is clicked on? And how if so.
Thanks for any help.
Edit Lucas: VBA tags added to code.