![]() |
|
#1
|
|||
|
|||
|
Hi, really hope someone can help with this.
I have a macro button that sends a document via email. I would also like the macro to save the file in a particular location with some details in the filename. For example, path: C:\reports\templates filename: to include, MMR, Author, date, time, example: MMR A.N.Other 20160108 09:10.doc My current macro code is below. 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
With EmailItem
.Subject = "Monthly Management Report"
.Body = "Hi Brian," & vbCrLf & _
"Please find attached our Monthly Management Report" & vbCrLf & _
"Regards,"
.To = "n.parsons@lur.co.uk"
.Importance = olImportanceNormal
.Attachments.Add Doc.FullName
.Send
End With
Application.ScreenUpdating = True
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
End Sub
Private Sub CommandButton2_Click()
ActiveDocument.PrintOut Copies:=1
End Sub
|
| Tags |
| macro, save |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Adding a Save button into a document
|
WyRm | Word | 12 | 03-23-2013 05:10 AM |
| Word ask to save template whenever i save a derived document | jorbjo | Word | 3 | 10-04-2012 10:52 AM |
Add a "SAVE" Button to a form template?
|
Dave L | Word | 9 | 03-21-2012 07:04 PM |
Adding email button to Word form
|
leilers | Word | 5 | 01-09-2012 03:21 PM |
| Adding an Email Button to a Word Document | maddoktor | Word | 0 | 12-01-2011 01:32 PM |