outofpractice
Registered User.
- Local time
- Today, 09:42
- Joined
- May 10, 2011
- Messages
- 32
I have a feeling this must be covered somewhere, but I didn't find anything - if it's out there I'm sorry for asking, and feel free to point me in the correct direction. Right now I have a macro that will open lotus notes & attach my report into it and all I have to do is hit the send button. This runs every Thursday afternoon as an autoexec with a scheduled windows event. I would like to completely automate this and have the autoexec command that runs just email the report without any intervention from me.
Furthermore I have some code which will automatically email people, but I don't know how to make it add the query I want. Below is the code which executes on a button press, any suggestions on how to modify this to include a query with the email (can be as an attachment or as text, makes not difference). Please keep in mind that I am not a programmer - it was very trying for me to get the automated email code pieced together. Thanks for any assistance as always!
Furthermore I have some code which will automatically email people, but I don't know how to make it add the query I want. Below is the code which executes on a button press, any suggestions on how to modify this to include a query with the email (can be as an attachment or as text, makes not difference). Please keep in mind that I am not a programmer - it was very trying for me to get the automated email code pieced together. Thanks for any assistance as always!
PHP:
Private Sub Command93_Click()
On Error GoTo Err_Command93_Click
Dim session As Object
Dim db As Object
Dim doc As Object
Dim intUserResponse As Integer
Dim recipient(3) As Variant
Dim recipCC(2) As Variant
recipient(0) = "email address"
recipCC(0) = "email address"
Set session = CreateObject("Notes.NotesSession")
Set db = session.GETDATABASE("", "")
Call db.OPENMAIL
Set doc = db.CREATEDOCUMENT()
doc.Form = "Memo"
doc.Subject = "Form Request Completed - # " & ID.Value
doc.body = "This change to " & Form_Number.Value & " was submitted by "
& Submitted_By.Value & ". This change was requested by " &
Requestor_Name.Value & "."
doc.SendTo = recipient
doc.CopyTo = recipCC
Call doc.SEND(False)
DoCmd.GoToRecord , , acNext
Exit_Command93_Click:
Exit Sub
Err_Command93_Click:
MsgBox Err.Description
Resume Exit_Command93_Click
End Sub