Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Lotus Notes Q: Copy'n paste from Excel AND place Excel attachment

Hi all,

I know the way to place Excel file as attachement in Lotus Notes memo and also know the way to copy a range in Excel and paste it as part of body (although scaling is VERY dodgy!).

I OBVIOUSLY browsed past Newsgroup postings and even IBM Web site! NO info... And, I did so Notes type libraries (domobj.tlb and notes32.tlb) .

What I can NOT do is achieving both! The first code does copy and paste of Excel range as part of body (NOT text, but image). The second does create attachement. I spotted both codes from somewhere on the web (thank to the coders!).

Can anyone shed a light to acheive both please?

Cheers,
=============
Sub CopyAndPaste()
Dim Server As String, Database As String
Dim Notes As Object
Dim db As Object
Dim WorkSpace As Object
Dim doc As Object
Dim UIdoc As Object
Dim AttachME As Object
Dim EmbedObj As Object

Set Notes = CreateObject("Notes.NotesSession")
Set db = Notes.GETDATABASE("", "")
Set WorkSpace = CreateObject("Notes.NotesUIWorkspace")
Set doc = WorkSpace.ComposeDocument(Server, Database, "Memo")

Set UIdoc = WorkSpace.CurrentDocument
Call UIdoc.FieldSetText("EnterSendTo", "tetsuya oguma")
Call UIdoc.FieldSetText("Subject", "Pasting from Excel to Notes")

Range("test").Copy 'the range to copy
Call UIdoc.GotoField("Body")
Call UIdoc.Paste
Call UIdoc.SEND
UIdoc.Close

Set Notes = Nothing
Set db = Nothing
Set WorkSpace = Nothing
Set doc = Nothing
Set UIdoc = Nothing
End Sub
=====================
Public Sub SendAttachment()
Dim Maildb As Object 'The mail database
Dim UserName As String 'The current users notes name
Dim MailDbName As String 'THe current users notes mail database name
Dim MailDoc As Object 'The mail document itself
Dim AttachME As Object 'The attachment richtextfile object
Dim Session As Object 'The notes session
Dim EmbedObj As Object 'The embedded object (Attachment)

Set Session = CreateObject("Notes.NotesSession")

Set Maildb = Session.GETDATABASE("", "")
If Maildb.ISOPEN = True Then
Else
Maildb.OPENMAIL
End If

Set MailDoc = Maildb.CREATEDOCUMENT
MailDoc.Form = "Memo"
MailDoc.sendto = "Tetsuya Oguma"
MailDoc.Subject = "This is subject"
MailDoc.Body = "BodyText"
MailDoc.SAVEMESSAGEONSEND = False

Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment")
Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", "C:\MyFile.xls", "Attachment")
MailDoc.CREATERICHTEXTITEM ("Attachment")

MailDoc.PostedDate = Now()
MailDoc.SEND 0, Recipient

Set Maildb = Nothing
Set MailDoc = Nothing
Set AttachME = Nothing
Set Session = Nothing
Set EmbedObj = Nothing
End Sub



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Lotus Notes Q: Copy'n paste from Excel AND place Excel attachment

Sorry I forgot to tell I am using Excel 97 SR-2 on Windows NT4.

Cheers,
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
Lotus Notes - Unable to Copy Paste Special in macro Joe Wildman[_2_] Excel Worksheet Functions 2 February 8th 09 09:43 PM
Lotus Notes Doc LINK in Excel??? Yogi Smith Excel Discussion (Misc queries) 0 July 10th 06 04:24 AM
Emailing Lotus Notes From Excel Charles Excel Programming 0 February 12th 04 03:24 PM
Macro to access Lotus Notes witih attachment - Beverly[_3_] Excel Programming 1 January 14th 04 11:36 PM
Sending Excel file as attachment to Lotus Notes mail Simon Lenn Excel Programming 2 December 9th 03 07:47 PM


All times are GMT +1. The time now is 07:31 PM.

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"