Right now I am using this code to copy a page, e-mail it, then delete the copy.
What I've run into is that the receiver of the e-mail will not be the same. So, what I'm wanting to do is have a cell contain the name of person that will receive the e-mail and then when the command button is clicked it will send it to that name.
Here's the code:
Sub SendIt()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Sheet1.Copy
ActiveWorkbook.SaveAs Filename:="Purchase Journal.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=True, CreateBackup:=False
Application.Dialogs(xlDialogSendMail).Show _
arg1:="email.address", _
arg2:="subject"
CloseWorkbook
DeleteFile
End Sub
In arg1 I can specify who receives the e-mail. How can I change it to pick the name from the cell? Another thing is the e-mail address will be the first letter of the first name and ony 7 letters of the last name. ie. if the cell contains the name Fred Bruemmer, the e-mail address would be fbruemme@address.com. We use Lotus Notes as for our e-mail, can I access the address book somehow?
Thanks,
viper
What I've run into is that the receiver of the e-mail will not be the same. So, what I'm wanting to do is have a cell contain the name of person that will receive the e-mail and then when the command button is clicked it will send it to that name.
Here's the code:
Sub SendIt()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Sheet1.Copy
ActiveWorkbook.SaveAs Filename:="Purchase Journal.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=True, CreateBackup:=False
Application.Dialogs(xlDialogSendMail).Show _
arg1:="email.address", _
arg2:="subject"
CloseWorkbook
DeleteFile
End Sub
In arg1 I can specify who receives the e-mail. How can I change it to pick the name from the cell? Another thing is the e-mail address will be the first letter of the first name and ony 7 letters of the last name. ie. if the cell contains the name Fred Bruemmer, the e-mail address would be fbruemme@address.com. We use Lotus Notes as for our e-mail, can I access the address book somehow?
Thanks,
viper