• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

lotus notes from VBA

lilelvis2000

Super poster
Joined
Jul 11, 2005
Messages
4,307
Likes received
50
Thanks received
16
Location
Armpit of UK
Anyone on here know anything about automating lotus notes from VBA? I've got to put out a proof of concept for a quick and dirty reports distribution. One way I tried to embed the .xls file into the e-mail body as an attachment doesn't seem to work as I get a authorization failure. sending without the attachment work however, so something weird there.. I wonder if it has to do with the database..as it appears to use two different nsf files???

Of course that will fill the e-mail server with lots of xls files..so now Im thinking about just putting a link to the file on the network. something like file://<server>/<share>/<path>/file.xls which would look like a hyperlink.
Anyone done this in lotus notes using VBA?
 
Anyone on here know anything about automating lotus notes from VBA? I've got to put out a proof of concept for a quick and dirty reports distribution. One way I tried to embed the .xls file into the e-mail body as an attachment doesn't seem to work as I get a authorization failure. sending without the attachment work however, so something weird there.. I wonder if it has to do with the database..as it appears to use two different nsf files???

Of course that will fill the e-mail server with lots of xls files..so now Im thinking about just putting a link to the file on the network. something like file://<server>/<share>/<path>/file.xls which would look like a hyperlink.
Anyone done this in lotus notes using VBA?

Not me personally, but a bank I was at a couple of years ago did a similar sort of thing - automated emailing of statements/spreadsheets to clients. So you can definitely do it, not sure if it's done using VBA though.
 
Disclaimer: I did some Notes development about a hundred years ago and don't remember most of it.

I'm not sure I understand what you're trying to do. Are you just trying to mail out an excel file as an attachment?

If you want it somewhere central, it wouldn't be too dificult to chuck together a new Notes database, stick it on a server and upload the xls file as an attachment to a document. Then you can just send out a link every time a new document's entered into the database.
 
Well, the method I'm using is the xls files are created each month..about 100 of them. These are placed into a folder on the LAN. (I suppose we could also put these into a notes document library as well). I then walk over each file..grab the first four characters which I then use as a key into a Access database to find all the e-mail addresses which are associated. I create a e-mail, attach the file and then send it.

it is now working..the problem was the default database was pointing at someone else's..the previous owner of the laptop.

I can also embed a hyperlink to the file using file://...../../file.xls in the body which will save space on the e-mail servers...something which the admins have been complaining about for a couple of years now.

this is just a stop gap until we can get a proper sharepoint solution designed. Well at least that's the way I'm pushing the customer...'coz I don't want to become a notes programmer.
 
Here's the bit of code I use for attaching files to a Notes Email.

If you need any other help let me know.

fName is a list of files seperated by ;

strAttachments = fName
If strAttachments <> "" Then
varAttachments = Split(strAttachments, ";")
If IsNull(varAttachments) = False Then
For intLoop = LBound(varAttachments) To UBound(varAttachments)
Set objAttachment = objAttachRTF.EmbedObject(1454, "", varAttachments(intLoop))
Next intLoop
Else
End If
End If
 
Programmatically Creating File Links in Lotus Notes Memo

Programmatically Creating File Links in Lotus Notes Memo

I spent a while researching this problem and eventually came up with an answer. The Domino Com has been designed not to allow file links because its counter productive for sharing data online according to IBM site. I think otherwise! My data IS shared on the server with colleagues.

Assuming youve got the email construct sorted heres a few pointers for creating the links with sereral options for file path syntax IE number of slashes and mapped or unc paths...enjoy!

(this will not work with spaces in folder or file names)

'==================
'rich text version
'==================
Set docMemo = dbMail.CreateDocument()
Call docMemo.ReplaceItemValue("Form", "Memo")
Call docMemo.ReplaceItemValue("SendTo", SendTo)
Call docMemo.ReplaceItemValue("Subject", Subject)

Set objBody = docMemo.CreateRichTextItem("Body")
Call objBody.AppendText(Body)

Call objBody.AppendText(vbCrLf)
Call objBody.AppendText(vbCrLf)
Call objBody.AppendText("file:///W:\WL_Records\Technical\Insight\Exceptions\test.txt") 'works (3 slashes)
Call objBody.AppendText(vbCrLf)
Call objBody.AppendText("file://W:\WL_Records\Technical\Insight\Exceptions\test.txt") 'works (2 slashes)
Call objBody.AppendText(vbCrLf)
Call objBody.AppendText("file:/W:\WL_Records\Technical\Insight\Exceptions\test.txt") 'fails (1 slashes)
Call objBody.AppendText(vbCrLf)
Call objBody.AppendText("file:W:\WL_Records\Technical\Insight\Exceptions\test.txt") 'works (0 slashes)
Call objBody.AppendText(vbCrLf)
Call objBody.AppendText("file://servername\CEFS9028\w\WL_Records\Technical\Insight\Exceptions\test.txt") 'works (2 f/slash unc)
Call objBody.AppendText(vbCrLf)
Call objBody.AppendText("file:\\servername\CEFS9028\w\WL_Records\Technical\Insight\Exceptions\test.txt") 'works (2 b/slash unc)
 
Think you may have missed the boat on this one, check the date on the original post...

Guess your not too busy then :wink

The only reason I added this is for techies trying to achieve the same result - and from what Ive read theres quite a few of em out there - this is the closest thing to a solution. So next time someone googles lotus/notes/memo/hyperlink/etc they should find this - voila!
 

Advertisers

Back
Top