Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Acess to Lotus Notes 1

Status
Not open for further replies.

stazza18

IS-IT--Management
Jun 1, 2004
25
US
We currently run monthly reports generated by a query we have in our system. The bosses want us to find a way to automatically email specific people in direct correlation to the results in our query. I have enabled the users to open our Lotus Notes application, but I wasn't sure if there was a way to allow for us to send out this automatic email from our end. We were hoping not to have a Notes developer get involved, but I am not sure what needs to be done. Does this sound like we can do without writing scripts in Lotus Notes.
 
Are you trying to email something from Access? Kind of hard to tell from your post. You don't mention Access except in your title and then you say that someone else has rights to the open Notes Application.

If what you are asking is:

We have an Access application that generates query results and we want to email those results to specific people using a Notes email client.

Then, the answer is - No you don't need LotusScript to do this (not directly at any rate). You create an instance of Notes through VBA and send the email from Access.

Does that answer your question?

Leslie
 
Do a keyword search for access export lotus notes email on the whole site.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks, we were trying to send out an automated email through lotus notus based on results of a query we built in Access. As of now, when we run the query we have to go and email the appropriate people individually in response to each record pulled by the query. This is what we were hoping to automate.
 
You can have Access generate an email for each record and send it.

Leslie
 
Have a new problem, maybe someone can help. The query we pull for the emails has the email address and the number needed to be sent. Because we have multiple numbers per address I am just trying to get the test function to do the following. Take the email and loop through the recordset, adding each number to a string and then putting the string in the body of the email. Here is the test function I was able to piece together from the threads:

Sub test()
Dim strTo As String 'The sendee(s) Needs to be fully qualified address. Other names seperated by commas
Dim strSubject As String 'The subject of the mail. Can be "" if no subject needed
Dim strBody As String 'The main body text of the message. Use "" if no text is to be included.
Dim FirstFile As String 'If you are embedding files then this is the first one. Use "" if no files are to be sent
Dim SecondFile As String 'Add as many extra files as is needed, seperated by commas.
Dim ThirdFile As String 'And so on.
Dim db As DAO.Database
Dim rec As DAO.Recordset
Dim qry As QueryDef
Dim strCc As String
Dim strBcc As String


Set db = CurrentDb

' query extracting email addresses,
' or SQL statement to do the same
Set qry = db.QueryDefs("qryemail")
Set rec = qry.OpenRecordset()

strTo = rec!email

Dim strNumbers As String

Do Until rec.EOF
If rec!email = strTo Then
strAccounts = strNumbers & rec!BoardingNumber & ","
'create a comma seperated list of filenames
rec.MoveNext
End If
Loop


strSubject = "Boarding Data Request"
strBody = "The attached is the boarding numbers."
strBody = strBody & vbCrLf & strNumbers
strBody = strBody & vbCrLf & "You will then be able to import the data from the DB import menu"
FirstFile = ""
SecondFile = ""
ThirdFile = ""

SendNotesMail strTo, strSubject, strBody, FirstFile, SecondFile, ThirdFile
End Sub


The problem is that it keeps hanging up my machine, does anyone see the problem in the code?
 
The problem is here:
stazza18 said:
Do Until rec.EOF
If rec!email = strTo Then
strAccounts = strNumbers & rec!BoardingNumber & ","
'create a comma seperated list of filenames
rec.MoveNext
End If
Loop
the MoveNext is inside the if, so then the condition is false the loop become endless as rec.EOF will not have any chance to change.
You have to rework your logic.


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Gotcha, I moved it move next outside of the loop but now I have a bunch of other problems. Thanks for all the help, I appreciate it.
 
You also need to change strTo after each move when it doesn't match the previous rec!email; something like this is what I use when doing this kind of calculation

Code:
strTo = ""
Do Until rec.EOF
  If rec!email <> strTo Then
    strTo = rec!email
    strAccounts = ""
  else
    if strAccounts = "" then
      strAccounts = strNumbers & rec!BoardingNumber
    else
      strAccounts = strAccounts & "," & rec!BoardingNumber
  End If
  rec.MoveNext
Loop

Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top