mmorris1965
New Member
- Joined
- Mar 14, 2016
- Messages
- 6
Good afternoon. I have a workbook that contains the code below. It works perfectly; however, I would like to alter the code to save the file to a network location with a new name derived from the text found in cell B8 on sheet1 and the current date and time rather than the users local files. I've tried several modifications to the code; however nothing seems to work.
Dim answer As String
answer = MsgBox("Save Form to Shared Folder and Notify Team Representatives?", vbYesNo, "Form Submission")
If answer = vbNo Then Cancel = True
If answer = vbYes Then
'open outlook type stuff
Set OutlookApp = CreateObject("Outlook.Application")
Set OlObjects = OutlookApp.GetNamespace("MAPI")
Set newmsg = OutlookApp.CreateItem(olMailItem)
'add recipients
'newmsg.Recipients.Add ("Jane Doe")
newmsg.Recipients.Add ("janedoe@xxx.org")
'add subject
newmsg.Subject = "A New Form Has Been Uploaded for Review"
'add body
newmsg.Body = "Form has been saved to Shared Network Folder for review and approval."
newmsg.Display 'display
newmsg.Send 'send message
'give conformation of sent message
MsgBox "The Form has been saved and Team Members have been notified.", , "Form Submission Confirmation"
End If
'save the document
'Me.Worksheets.Save
End Sub
Thank you in advance for your assistance
Dim answer As String
answer = MsgBox("Save Form to Shared Folder and Notify Team Representatives?", vbYesNo, "Form Submission")
If answer = vbNo Then Cancel = True
If answer = vbYes Then
'open outlook type stuff
Set OutlookApp = CreateObject("Outlook.Application")
Set OlObjects = OutlookApp.GetNamespace("MAPI")
Set newmsg = OutlookApp.CreateItem(olMailItem)
'add recipients
'newmsg.Recipients.Add ("Jane Doe")
newmsg.Recipients.Add ("janedoe@xxx.org")
'add subject
newmsg.Subject = "A New Form Has Been Uploaded for Review"
'add body
newmsg.Body = "Form has been saved to Shared Network Folder for review and approval."
newmsg.Display 'display
newmsg.Send 'send message
'give conformation of sent message
MsgBox "The Form has been saved and Team Members have been notified.", , "Form Submission Confirmation"
End If
'save the document
'Me.Worksheets.Save
End Sub
Thank you in advance for your assistance