OpenNTF.org - Creating an Empty Document Col
My Links (Not logged in)
Code Bin Search
 
Hosted by Prominic.NET
Rate This Code
5 - brilliant stuff
4 - very nice
3 - average
2 - needs work
1 - bad
   OpenNTF Code Bin
About This Code
Brief Description:
Creating an Empty Document Collection - Undocumented Code 
Rating:
Rating: 4.5 , Number of votes: 4 
Contributor:
David J Montalvo 
Category:
Lotusscript 
Type:
Miscellaneous 
Notes Version:
R8.x 
Last Modified:
19 Dec 2008 
OpenNTF Disclaimer

All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.

Code / Description
Have you ever wanted to build your own custom document collections? I have, imagine my surprise when I came across this undocumented code within the R8 Mail Template which lets you do just that:

CreateDocumentCollection()

This handy little timesaver allows you to quickly initialize an empty collection. Here is an example:

Dim MyCol As NotesDocumentCollection
Set MyCol = db.CreateDocumentCollection()

You are now free to add documents to your empty collection.

Note: Before this method the only way I knew of to achieve this was to "getalldocumentsbykey" using a key that does not exist.

Usage / Example
 Comments
Posted by Marko Bonaci on 12/24/2008 05:17:34 AMMore about this
http://ideajam.net/IdeaJam/P/ij.nsf/0/3FAD44895EB1665E8625738400731694?OpenDocument
Posted by Darius Burger on 09/29/2009 09:15:01 AMAwesomeness
Hi David -
Very cool! Will be handy as hell! :-)
Regards,
Darius
Posted by Tim Paque on 12/09/2009 06:53:52 PMAre you Kidding Me!
I've had to do crazy stuff to get around this like:
Dim DC as NotesDocumentCollection
Set DC = DB.GetProfileDocCollection("Chickens")
Now, this was fast and reliable, but kinda weird ;-)
Posted by Trond Nielsen on 01/24/2010 03:14:24 PMGlad someone found this one.
I sure spent hours coding around this one. Very welcome info.
Posted by Thomas Arnold on 03/23/2010 08:09:15 AMhelpfull
this helps, did with view.getdocumentbykey (with a key that does not exist), but now it's easier
 Add your comment!