Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I just wanted to say how much I have enjoyed these forums. I am a new user and have a lot of elementary questions. I get quick answers with a friendly attitude..."

Geography

Where in the world do Tek-Tips members come from?
AZGuy82 (TechnicalUser)
26 Jul 12 11:40
I am wondering if somebody can help me with a VBA code that would pass a file into the clipboard. So if a file exists (e.g. C:\Temp\1.xls) I would like to pass it into the clipboard so that I could paste it into a Lotus Notes email.

The following code allows me to create a Lotus Notes memo

[code] Dim CN, UserName, MailFile As String
Dim workspace As Object
Set workspace = CreateObject("Notes.NotesUIWorkspace")
Dim session As Object
Set session = CreateObject("Notes.NotesSession")
CN = session.COMMONUSERNAME
UserName = LCase(Left(Left$(CN, 1) & Right$(CN, (Len(CN) - InStr(1, CN, " "))), 8)) & ".nsf"
Set session = Nothing
MailFile = "mail\" & UserName

Dim NotesUIDoc As Object
Set NotesUIDoc = workspace.COMPOSEDOCUMENT("", "", "Memo")
Call NotesUIDoc.FIELDSETTEXT("EnterSendTo", "Me@Me.com")
Call NotesUIDoc.FIELDSETTEXT("EnterCopyTo", "Me2@Me.com")
Call NotesUIDoc.FIELDSETTEXT("Subject", "Test Email")
NotesUIDoc.GOTOFIELD "Body"
[/code]

And what I'm trying to do is paste the file at C:\Temp\1.xls into the email. I have found that if I pause the code, go into Windows explorer, select 1.xls and press Ctrl+C, then run

[code] Call NotesUIDoc.Paste [/code]

The file gets saved into the email.
However, I am unable to find the code that will pass the file into the clipboard so that the Paste function works.

I recognize there are other ways to send Lotusnotes emails with attachment (such as with createrichtext) but the methods I've seen do not allow you to edit the email. Could anybody provide help on this?

Thanks very much
Helpful Member!  PHV (MIS)
26 Jul 12 12:02
A starting point:

CODE

Set SA = CreateObject("Shell.Application")
Set F = SA.NameSpace("C:\Temp")
Set FI = F.ParseName("1.xls")
FI.InvokeVerb "Copy" 

Hope This Helps, PH.
FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

AZGuy82 (TechnicalUser)
26 Jul 12 13:31
PHV - this was exactly what I needed.
Thanks very much for your help and quick response!
HughLerwill (Programmer)
26 Jul 12 14:32
>other ways ... with createrichtext... and allow you to edit the email.
The penultimate post in thread222-766157: Lotus Notes Body Text/ Email VB may be of interest; consider its written for vb6.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close