473,322 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How did I add a 'Snapshot' attachment & email it Via Lotus Notes

Hi All

I need to email a report (with contains graphs) via Lotus Notes. I've tried the 'SendObjectSnp' method (which works with some Lotus Notes clients (but not many others)); so I used the code below: -

Public Sub SEND_EMAILS()

Dim session As Object
Dim db As Object
Dim doc As Object
Dim rtitem As Object
Dim rtitem_rtf As Object
Dim t_rpt_Name As String

Set session = CreateObject("Notes.NotesSession")
Set db = session.CurrentDatabase
Set doc = db.CreateDocument

'output report to text file on C:\

DoCmd.OutputTo acOutputReport, rpt_Name, acFormatSNP, ("C:\" & rpt_Name), False

doc.Form = "Memo"
doc.SendTo = temp_ccList
doc.subject = subject
doc.Body = Message


'Attach Doc 1
Set rtitem = doc.CreateRichTextItem("Attachment")
Call rtitem.EMBEDOBJECT(1454, "", "C:\" & rpt_Name)
Call rtitem.ADDNEWLINE(1, True)


This appears to attach a Richtext version of the report (rather than a snapshot) to the email, & sends it via Lotus Notes. However, if I try to open the attachment, SNAPSHOT doesn't recognise it; strangley I can view just the text part of the attachment if I just 'View' it within lotus notes.

How can I attach the report attachment so snapshot can open it (from Lotus Notes)?


Thanks in advance

Mark
Dec 13 '07 #1
2 3917
Dököll
2,364 Expert 2GB
Hi All

I need to email a report (with contains graphs) via Lotus Notes. I've tried the 'SendObjectSnp' method (which works with some Lotus Notes clients (but not many others)); so I used the code below: -
Expand|Select|Wrap|Line Numbers
  1. Public Sub SEND_EMAILS()
  2.  
  3. Dim session As Object
  4. Dim db As Object
  5. Dim doc As Object
  6. Dim rtitem As Object
  7. Dim rtitem_rtf As Object
  8. Dim t_rpt_Name As String
  9.  
  10. Set session = CreateObject("Notes.NotesSession")
  11. Set db = session.CurrentDatabase
  12. Set doc = db.CreateDocument
  13.  
  14. 'output report to text file on C:\
  15.  
  16. DoCmd.OutputTo acOutputReport, rpt_Name, acFormatSNP, ("C:\" & rpt_Name), False
  17.  
  18. doc.Form = "Memo"
  19. doc.SendTo = temp_ccList
  20. doc.subject = subject
  21. doc.Body = Message
  22.  
  23.  
  24. 'Attach Doc 1
  25. Set rtitem = doc.CreateRichTextItem("Attachment")
  26. Call rtitem.EMBEDOBJECT(1454, "", "C:\" & rpt_Name)
  27. Call rtitem.ADDNEWLINE(1, True)
  28.  
This appears to attach a Richtext version of the report (rather than a snapshot) to the email, & sends it via Lotus Notes. However, if I try to open the attachment, SNAPSHOT doesn't recognise it; strangley I can view just the text part of the attachment if I just 'View' it within lotus notes.

How can I attach the report attachment so snapshot can open it (from Lotus Notes)?


Thanks in advance

Mark
Hello MarkStorer!

Do youy mean firing a button that add an attachment to the body of a Notes email? Below VBA code which I use rather frequently, helps add such attachment, if you have Notes running:

Expand|Select|Wrap|Line Numbers
  1. Private Sub EmailAttachment_Click()
  2. On Error GoTo Err_MailMeReport_Click
  3.     Dim stDocName As String
  4.     Dim stPersonName As String
  5.     stDocName = "YourData" 'form being added to email
  6.     stPersonName = AssignedTo 'field that pulls email recipient
  7.     DoCmd.SendObject acForm, stDocName, , AssignedTo, , , "Please take a look, what are your thoughts?"
  8. Exit_MailMeReport_Click:
  9.     Exit Sub
  10. Err_MailMeReport_Click:
  11.     MsgBox "You have chosen to cancel the email", vbInformation + vbOKOnly, _
  12.                "Data Central" 'Err.Description
  13.     Resume Exit_MailMeReport_Click
  14. End Sub
  15.  
You will therefore have the option of adding as Snapshot or else...

Try it!
Dec 16 '07 #2
Hi Dököll

Thanks for your reply !

I've tried your code & it works a treat for outlook - I will use it in future applications if you don't mind ;-)

However the SendObject method is unreliable for LotusNotes clients (for some clients, it works & for others, it doesn't) the only methodolgy I've known to be reliable are variations of the script I've posted (which is basically a script released from this excellent forum).

However I've not found a LotusNotes-reliable script which can send anything other than an rtf format - unfortunately I need to send a snapshot (or PDF I guess) as I have a graph in my attachment the rtf format doesn't display graphics.

Any thoughts ?

Cheers

Mark
Dec 17 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: bruce | last post by:
I can send an email from any client (outlook, lotus notes), and fill it with all sorts of fonts (bold, courier, etc). When the mail is received, the client reads it inline, not as an attachment. ...
7
by: ursus | last post by:
Hi This is my second try... any takers? I have an application that is up and running. Everything is working perfectly. The application is written in VB 6 SP5 using Access 2000 to store the...
88
by: Mike | last post by:
Is there a way to determine what a user's default email client is? I read a post from 3 years ago that said no. I guess I'm hoping something has come along since then.
0
by: PZ Fosbeck | last post by:
I'm not a Lotus Notes developer but thanks to this group's archives have successfully created a function for sending Lotus Notes emails from Access. The follow code works great except I want to...
1
by: John Taylor | last post by:
I have some simple code behind a control button - basically prints a report and send the report (in snapshot format) to lotus notes for e-mailing. The code worked fine for ages and all of a...
3
by: =?Utf-8?B?SmFtZXNU?= | last post by:
I can create a message and send it via my btopenworld account but is the method the same when using Lotus Notes. I have no experience of Lotus Notes whatsoever. I have never seen it at all. ...
0
by: =?Utf-8?B?U293bXlh?= | last post by:
Hello, I would like to know how we can read the notes database in .C# .net. I tried the following mechanism.by which am unable to open the Database. NotesSession notesSession = new...
0
by: kohligagan2 | last post by:
Hi, I am working on a scenario . And scenario is I am trying to send an Email using my Lotus notes Client Id ( Lotus notes :- is used for messaging and sending mails work as a middleware) I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shćllîpôpď 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.