Hi,
I’m using the COM interop to do a little bit of programming with Lotus Notes using C# and I’m attempting to “pop” open a NotesDocument (ToDo, Memo, Appointment) from an external program.
I can do the same for Contacts using this format:
“Notes:///names.nsf/0/<the document’s UNID>”
However, since we are storing ToDo’s and Memo’s in the mailbox, I’m not too sure of how this should be.
I tried using the NotesDatabase.FilePath / FileName properties to get to the mail file, but it didn’t work out.
I managed to track this post but it didn’t help because I was not able to get to the Meta property of the NotesDocument.
http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/02e0e879f0f6b3d780256db400410a78?OpenDocument
Any pointers would be highly appreciated !!!
Thanks in advance,
Daman
Subject: Open NotesDocument from external program
Use Session.getEnvironment to read the values of MailType, MailServer and MailFile.
If MailType is 0, then you need this format: Notes://MailServer/MailFile/0/unid
Otherwise, you need this format: Notes:///mail/maildb/nsf/0/unid
-rich
Subject: RE: Open NotesDocument from external program
Hi Rich,
I did what u have mentioned; got the environment variables and saw that the MailType was 0.
This is what url I form after that based on the format “Notes://MailServer/MailFile/0/unid”
Notes://CN=10.10.1.1/O=ABC/mail\dpradhan.nsf/0/1375C5EE652316FD8825747A001D6D6E
Unfortunately, when the Lotus Client opens, I get this message :
“Invalid directory name or device not ready.”
I tried with the second format : “Notes:///mail/maildb/nsf/0/unid” (trying my luck ! ) and I landed with “File does not exist”.
Any suggestions ?
ps : I gather that the “maildb” of the second format refers to the “MailFile” variable. What does the “mail” refer to ? ( I used the MailServer in its place)
Subject: RE: Open NotesDocument from external program
Remove the “O=Netelligent/” portion. A Notes URL requires just a host name or IP address, not the server’s fully distinguished name.
Subject: RE: Open NotesDocument from external program
Hi Rich,I removed the required part (“O=ABC/”) portion.
The string now looks like this :
“Notes://CN=10.10.1.1/mail\dpradhan.nsf/0/”
Am still getting the same message :
“Invalid directory name or device not ready”
Any suggestions ?
Thanks in advance !
Daman
ps : Regarding the second part of my earlier post -
“… the second format : “Notes:///mail/maildb/nsf/0/unid” (trying my luck ! ) and I landed with “File does not exist”. I gather that the “maildb” of the second format refers to the “MailFile” variable. What does the “mail” refer to ? ( I used the MailServer in its place)”, could you please provide the clarification ?
Subject: RE: Open NotesDocument from external program
Ooops. Sorry… Ididn’t notice the “CN=” part. Remove that, too. My may need to convert the “\” to a “/”, too. You want ‘Notes://ip-address/path/filename.nsf/0/unid’
Subject: RE: Open NotesDocument from external program
It worked … it worked !!! 
thank you soooooo much Rich !
if you could please help me now with the other doubts i have, it would be really great…
“… the second format : “Notes:///mail/maildb/nsf/0/unid” (trying my luck ! ) and I landed with “File does not exist”. I gather that the “maildb” of the second format refers to the “MailFile” variable. What does the “mail” refer to ? ( I used the MailServer in its place)”
Also, is this the way we approach opening of memos and appointments too ?
Subject: RE: Open NotesDocument from external program
The “Notes:///” format (three slashes) is used only when you are opening a local mail database. I.e., one that is stored on the hard drive of the user instead of the hard drive of a Domino server. MailType will be “1” in that configuration. You will ignore the MailServer configuration because you’re not accessing the server. “mail/” will be part of the URL only if the local mail database is stored in a folder called “mail” inside the user’s Lotus\Notes\Data folder. The MailFile entry in Notes.ini will include the folder path, so you don’t have to do anything special to include “mail” or anything else – except maybe convert "" characters into “/”.
Subject: RE: Open NotesDocument from external program
Hi Rich,
Am indeed very grateful to you for all the info you provided. I do hope you keep helping newbie’s like me in untangling the Lotus web !
Thank you once again !!!
Daman