View Single Post
 
Old 05-16-2014, 12:15 PM
PANTECH PANTECH is offline Windows 7 64bit Office 2007
Novice
 
Join Date: May 2014
Posts: 4
PANTECH is on a distinguished road
Default Word7 VBA- need userform screenshot to attach to email

I need to be able to complete all fields on the userform then click the Submit command button and automatically have the screenshot of only the userform saved as an attachment to a predifined email. The below code will send an email attachment but there is no screen shot.

Please help

Code:
Private Sub Workbook_Open()
Application.Visible = True
frmWALKAROUND.Show
End Sub
Private Sub SpinButton1_Change()
TextBox1.Text = SpinButton1.Value
SpinButton1.Min = 0
SpinButton1.Max = 9
End Sub
Private Sub SpinButton2_Change()
TextBox2.Text = SpinButton2.Value
SpinButton2.Min = 0
SpinButton2.Max = 9
End Sub
Private Sub SpinButton3_Change()
TextBox3.Text = SpinButton3.Value
SpinButton3.Min = 0
SpinButton3.Max = 9
End Sub
 
Private Sub SpinButton4_Change()
TextBox4.Text = SpinButton4.Value
SpinButton4.Min = 0
SpinButton4.Max = 9
End Sub
 
Private Sub commandButton1_Click()
Dim OL As Object
Dim EmaiItem 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 = "Walkaround"
.To = "myemailaddress"
.Importance = olImportanceNormal
.Attachments.Add Doc.FullName
.Send
End With
Application.ScreenUpdating = True
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
Application.ActiveDocument.Close
End Sub
Reply With Quote