Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-13-2012, 11:20 PM
bigbird69 bigbird69 is offline Command button - save in temp folder and send email with attachment Windows 7 64bit Command button - save in temp folder and send email with attachment Office 2010 64bit
Novice
Command button - save in temp folder and send email with attachment
 
Join Date: Nov 2012
Posts: 8
bigbird69 is on a distinguished road
Default Command button - save in temp folder and send email with attachment

Hello all,


i have spent some time making a new user form for the hr staff.



i have a command button which will save the form and attach to a new email with email address and subject fields filled in. my only problem is once the form has been filled in and sent off the info is saved into the form. is there a way around this?

it is a macro enabled form which contains a date picker, active x text box, and check boxes. i have also protected the form from being edited.


here is the current code i am using
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 = "New company Employee"
  .Body = "" & vbCrLf & _
    "" & vbCrLf & _
    ""
  .To = "ITSupport@company.com.au"
  .Attachments.Add Doc.FullName
  .Display
End With
Application.ScreenUpdating = True
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
 
End Sub

Last edited by macropod; 11-14-2012 at 02:21 AM. Reason: Added code tags & formatting
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command button - save in temp folder and send email with attachment Command Button doesnt work on network rmw85 Word VBA 1 04-25-2012 01:02 PM
outlook 2003 always not remove temp copy of opened attachments in temporary folder c.itech Outlook 0 06-20-2011 10:34 PM
Command button - save in temp folder and send email with attachment email as pdf attachment - subject line and attachment named after mail merge Nexus Mail Merge 12 04-13-2011 11:34 PM
Command button - save in temp folder and send email with attachment Command Button cksm4 Word VBA 7 02-27-2011 08:47 PM
How can I save multiple email messages to a file folder? (crosspost) tupham Outlook 0 08-04-2008 07:56 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:53 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft