Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Notes for non-Notes developer

Status
Not open for further replies.

petermeachem

Programmer
Aug 26, 2000
2,270
GB
I didn't get a reply, so I'm asking again.

A customer wants to send email from my VB programme and they use Notes and I don't. I would need to make sure the programme works obviously. Is there some fairly small download I can do to get enough Notes programme just to see if my email bit works. I started looking at the downloads on IBM, but chickened out as they look a bit huge. Peter Meachem
peter @ accuflight.com

 
I can't understand what you need?
Do you need the Lotus Notes Notes Program to test the software you are working on?

You shouldn't be able to find Lotus Notes as a download as you need to purchase it. It's not available as a Freeware item like Adobe Acrobat Reader is.

If I am completely off track and this is not what you mean, please elaborate more on your question above.
 
OK,

According to a message in this forum, to send email via Notes you need something like,

Set s = CreateObject("Notes.Notessession") 'create notes session

and so on

As I don't own Notes, I have a problem with CreateObject("Notes.Notessession").

In order to test this code, I need to be able to get hold of this object, and I need it to run to the point where I can be sure I've got the syntax right.

I don't want to buy Notes, I don't want to do anything with Notes except check this code. A demo would be fine, just to give me time to check this bit out.

As I don't know anything about Notes (should be obvious by now), I don't know what, if anything, I can download from IBM to get the above functioning.

Do you see what I mean now?

Peter Meachem
peter @ accuflight.com

 
I mentioned I don't know Anything about all this stuff.

I'm downloading

Notes/Domino for Windows 2000, Windows Millennium (Release Notes Notes/Domino 6 Pre-Release 2)

which seems suspiciously small at 6Mb.

Is this what I want?



Peter Meachem
peter @ accuflight.com

 
I assume it was wrong.

Help please! Peter Meachem
peter @ accuflight.com

 
The client seems to be 131Mb.

That's a bit gross, surely there must be an easier way considering I don't seem to have a T1 line in here. Peter Meachem
peter @ accuflight.com

 
Can't do that really as they are in America and there are licence issues with the second suggestion.

Anyway, I found a copy of Notes V5 beta on an old cover disc. I installed it and was rather hoping to find an activex, or something I could use as a reference in a vb programme. Doesn't seem to be anything like that. Any idea what I should be looking for? Peter Meachem
peter @ accuflight.com

 
Your client could download a sixty day trial from the Lotus site and send it on CD to you. This might be useful as 5.03 had some OLE (or COM) fixes in it.

The first url below will probably be enough information to get you started with creating emails.

How to Use the Notes LotusScript Classes with Visual Basic

You should refer to the published documentation for more information and for examples. Use the "Search" button:


Dale

The following url's are just more reference information

Accessing the Domino Objects through COM

Examples: Accessing the Domino Objects through COM

Initialize method of NotesSession

InitializeUsingNotesUserName method of NotesSession

Using OLE

Examples: Using OLE
Why don't you ask the Notes Wizards at
 
Re

Why don't you ask the Notes Wizards at
As you are obviously fairly closely associated with that company you should know that there are no relevant references, or at least none that I can find.

If there were, then you could have answered me directly here couldn't you.

While we are on the subject, perhaps you could be so good as to tell me how to unsubscribe as there seems to be no way to do it from your site.

Do you feel you are quite close to selling your services on tek-tips? Peter Meachem
peter @ accuflight.com
 
That was my sig - It refers to a company I work for. It was not meant to be a solution or a recommendation. I assume from your sig that you are accuflight.

The advice was to look at the first url listed which has an example of how to send a Notes email using the COM objects. The source is included. I don't know what else you need to know unless you say where you are having difficulty. Please respond with the area you are having the problem with and we will try to assist.

Best regards

Dale

 
Here's some code that works when I run it in Word97. It did not take much research and testing to get it working.

Option Explicit

Private Sub CommandButton1_Click()

Dim body As NotesRichTextItem
Dim dataDir As NotesDbDirectory
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim style As NotesRichTextStyle

Dim session As New NotesSession
Call session.Initialize("") 'Prompt for password for current id

Set dataDir = session.GetDbDirectory("")
Set db = dataDir.OpenMailDatabase
Set doc = db.CreateDocument()
Set body = doc.CreateRichTextItem("Body")

Set style = session.CreateRichTextStyle
style.FontSize = 24 'Point size
style.NotesColor = 2 'COLOR_RED
style.NotesFont = 0 'FONT_ROMAN

Call doc.ReplaceItemValue("Form", "Memo")
Call doc.ReplaceItemValue("SendTo", "User Name/orgunit/org")
Call doc.ReplaceItemValue("Subject", "This doc mailed from MS Office 97")
Call body.AddNewLine(1)
Call body.AppendStyle(style)
Call body.AppendText("Hallo Peter")
Call doc.Send(False)

End Sub
 
Thanks for your help, but you have missed the point slightly of what I was asking.

I installed it and was rather hoping to find an activex, or something I could use as a reference in a vb programme. Doesn't seem to be anything like that. Any idea what I should be looking for?

In your example you have
Dim session As New NotesSession

NotesSession must be an ocx or a type library. The pc I've installed my copy of notes on has vb.net which has no reference I can see to NotesSession.
Peter Meachem
peter @ accuflight.com

 
Add into your project references the following file:

c:\lotus\notes\domobj.tlb

(where c:\lotus\notes is your lotus notes program directory)

Hope this helps, I have no idea how this should work with .net (if at all).

Dale
 
Great. Just what I needed to know, thanks very much. Peter Meachem
peter @ accuflight.com

 
I've seen many different ways to send mail from Notes using Access and all seem to work fine. However, I'm trying to create the message, but not actually send it. I'd like to create the memo and have it just sit there so that I can manually add an attachment that will be printed to a PDF file at the same time I kick off the process to create the mail memo in Notes. Does anyone have any suggestions on how to simply create the memo using code in VBA?

Any help is greatly appreciated.

Thanks,
Cory
 
Use the example code and replace
Call doc.Send(False)
with
Call doc.Save( True , True )
That should do it! Find me @ onlinecorporatesoftware.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top