Inserting Images into Lotus Notes Email

santeria

Well-known Member
Joined
Oct 7, 2003
Messages
1,844
Finally I have the code all okay for Sending Reports, and other extra comments etc...

And now...
Is there code available for picking up images ( Screen snaps) and inserting into an email in Notes after the Body of the Message?

Either a reference to a link or some code would be greatly appreciated, cos I cannot find any info at this point in the archives ( Presuming I have searched using proper parameters ).

Ta

:bow:
 
Hello again,

Get rid of that, that's from a different procedure (or two). Use the last big block of code (two sub routines) I posted and nothing else. ;)
 
Upvote 0

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
It seems that what you have with this current Macro is more refined.
It's impressive.

What I am just trying to say is that it did the job, except that it currently needs additional references, which is what the new macro will hopefully do.

Currently it's not happening... well, not fully executing... it goes so far, and then quits.

The Subject Variable is a Key factor, as is the xls file, and the comment file is no longer a constant, hence the need to pick up a daily comment file from the update directory.


Ta

:bow:
 
Upvote 0
This discussion is too general to be meaningfull at this point me thinks. Please post your revised 'working code.'
 
Upvote 0
Here it is

Code:
Sub MULTISENDFUNCTIONEOD()
Dim MyPic1 As Object, MyPic2 As Object
Application.ScreenUpdating = False
Set MyPic1 = ActiveSheet.Pictures.Insert( _
    "M:\EXPORTS\02_FEBRUARY\CMS\DAILY\1.jpg")
Set MyPic2 = ActiveSheet.Pictures.Insert( _
    "M:\EXPORTS\02_FEBRUARY\CMS\DAILY\2.jpg")
Call SendMail(MyPic1, MyPic2)
MyPic1.Delete: MyPic2.Delete
Set MyPic1 = Nothing: Set MyPic2 = Nothing
Application.ScreenUpdating = True
End Sub

Private Sub SendMail(ByRef MyPic1 As Object, ByRef MyPic2 As Object)

Dim Notes As Object, db As Object, WorkSpace As Object
Dim UIdoc As Object, AttachMe As Object, EmbedObj As Object
Dim UserName As String, MailDbName As String

Set Notes = CreateObject("Notes.NotesSession")

UserName = Notes.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, _
    (Len(UserName) - InStr(1, UserName, " "))) & "Name.sf"

Set db = Notes.GetDataBase(vbNullString, MailDbName)

Set WorkSpace = CreateObject("Notes.NotesUIWorkspace")
Call WorkSpace.ComposeDocument(, , "Memo")

Set UIdoc = WorkSpace.CurrentDocument
Call UIdoc.FieldSetText("SendTo", "Name/CCMG/CVG") 'Recipient
Call UIdoc.FieldSetText("Subject", "Pic Time")

Call UIdoc.GotoField("Body")
Call UIdoc.InsertText(WorksheetFunction.Substitute( _
    "Hey Buddy,@@Check out the pics eh!@@", _
    "@", vbCrLf))

MyPic1.Copy: Call UIdoc.Paste

Call UIdoc.InsertText(WorksheetFunction.Rept(vbCrLf, 2))

MyPic2.Copy: Call UIdoc.Paste

Call UIdoc.InsertText(Application.Substitute( _
    "@@Don't Be A Stranger,@Moi", "@", vbCrLf))
Application.CutCopyMode = False

Set AttachMe = UIdoc.Document.CreateRichtextitem("Attachment")

Set EmbedObj = AttachMe.EmbedObject(1454, _
    vbNullString, "M:\EXPORTS\02_FEBRUARY\CMS\DAILY\comment.txt", "Attachment")

UIdoc.Document.posteddate = Now
'Call UIdoc.Send(False)'
Call UIdoc.Close

Set UIdoc = Nothing: Set WorkSpace = Nothing
Set db = Nothing: Set Notes = Nothing
Set EmbedObj = Nothing: Set AttachMe = Nothing

End Sub

I have a Macro for basic send of Email. That Works.
I can post that as well if you like.


Ta

:bow:
 
Upvote 0
Tried that.
Does not work.
Basic format is Name/Domain/Dom_abbrev@dom_abbrev

Thats the only way.

same with groups.

If I could figure a way to add a qualifying comment in the first sub, then I suspect it may work, but probably not.

From what I have seen, it should work in theory.
I just have no idea what to add or subtract.


Ta

:bow:
 
Upvote 0
This was the same issue that the Pook was having me thinks. Here we go:

R4.X

Call UIdoc.FieldSetText("SendTo", "Name/CCMG/CVG") 'Recipient

R 5.X

Call UIdoc.FieldSetText("EnterSendTo", "Name/CCMG/CVG") 'Recipient

I assume you want the latter at this point. Lotus changed the field names with the new version (Thanks IBM (or something :-P )!).

I have not tested this (no current access to R5). :-P
 
Upvote 0
Very Cool.

That covers the Send to Principle Field ( in the TO ).

Now I just have to work on the Attachment of the File, Comment text insert, and the Subject Line Variables.


Ta

:bow:
 
Upvote 0
The Final window I need to deal with is the Window that Determines wether the Item is sent, or if the item is discarded( a whole range of variations appear in one dialogue box).

I was wondering if there was a way to command this to Send, and close the Dialogue Box.


Ta

:bow:
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,729
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top