Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Email a chart from excel via Lotus Notes

I wanted to email a chart from excel via Lotus Notes and it is easy to
set up using the uidocument process in Lotus Notes. However I have not
found a way of closing the uidocument from vba. This code is a way
around the problem because it does not involve uidocument.

ActiveSheet.ChartObjects("Chart 122").Activate
ActiveChart.ChartArea.Select
'ActiveSheet.ChartObjects("chart 122").Select
strGIFFileName = "d:\graff1.gif"
Selection.Parent.Export Filename:=strGIFFileName
Set s = CreateObject("Notes.NotesSession")
Set db = s.GetDatabase("", "d:\notes\dgb1.nsf")
Set stream = s.CreateStream
s.ConvertMime = False
Set doc = db.CreateDocument
Set body = doc.CreateMIMEEntity
Set header = body.CreateHeader("Subject")
Call header.SetHeaderVal("Subject......")
Set header = body.CreateHeader("To")
Call header.SetHeaderVal("address.....")
Set stream = s.CreateStream
If Not stream.Open("D:\graff1.gif", "binary") Then
GoTo ExitSub
End If
If stream.Bytes = 0 Then GoTo ExitSub
End If
Call body.SetContentFromBytes(stream, "image/gif",
ENC_IDENTITY_BINARY)
Call stream.Close
Call doc.Save(True, True)
Call doc.Send(False)
ExitSub:
s.ConvertMime = True ' Restore conversion
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Email a chart from excel via Lotus Notes

Maybe you can use a part of this macro for Outlook
http://www.rondebruin.nl/mail/folder2/chart.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


wrote in message oups.com...
I wanted to email a chart from excel via Lotus Notes and it is easy to
set up using the uidocument process in Lotus Notes. However I have not
found a way of closing the uidocument from vba. This code is a way
around the problem because it does not involve uidocument.

ActiveSheet.ChartObjects("Chart 122").Activate
ActiveChart.ChartArea.Select
'ActiveSheet.ChartObjects("chart 122").Select
strGIFFileName = "d:\graff1.gif"
Selection.Parent.Export Filename:=strGIFFileName
Set s = CreateObject("Notes.NotesSession")
Set db = s.GetDatabase("", "d:\notes\dgb1.nsf")
Set stream = s.CreateStream
s.ConvertMime = False
Set doc = db.CreateDocument
Set body = doc.CreateMIMEEntity
Set header = body.CreateHeader("Subject")
Call header.SetHeaderVal("Subject......")
Set header = body.CreateHeader("To")
Call header.SetHeaderVal("address.....")
Set stream = s.CreateStream
If Not stream.Open("D:\graff1.gif", "binary") Then
GoTo ExitSub
End If
If stream.Bytes = 0 Then GoTo ExitSub
End If
Call body.SetContentFromBytes(stream, "image/gif",
ENC_IDENTITY_BINARY)
Call stream.Close
Call doc.Save(True, True)
Call doc.Send(False)
ExitSub:
s.ConvertMime = True ' Restore conversion
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I send an Excel workbook through Lotus Notes Email? Valerie Excel Discussion (Misc queries) 1 May 3rd 08 04:51 PM
?? Email Excel sheet thru Lotus Notes Jaylin Excel Discussion (Misc queries) 1 October 16th 07 05:12 PM
??email excel sheet w Lotus notes Jaylin Excel Discussion (Misc queries) 3 October 12th 07 03:40 PM
excel close everytime I receive an email with lotus notes 6.5.5 sigh Excel Discussion (Misc queries) 0 May 31st 06 06:53 AM
Excel VBA to send email using Lotus Notes Nirmal Singh Excel Programming 3 April 28th 05 11:15 PM


All times are GMT +1. The time now is 01:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"