Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Another thought on moving to folders, especially if the database isn't set up for <a href="http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/topic/com.ibm.designer.domino.main.doc/H_FOLDERREFERENCES_PROPERTY_1349_ABOUT.html" rel="nofollow">FolderReferences</a> to work:</p> <p>You can iterate over the array of NotesView objects obtained from the NotesDatabase object's Views property. Each NotesView has a property that tells you if it is a folder. </p> <p>Once you know about all the folders, you can iterate within each folder and collect a list of NotesDocuments that are contained within. Then by storing this information in a dictionary you could use this as a lookup while you process each document to decide what folder(s) it needs to be placed in.</p> <p>Something like this (not tested):</p> <pre><code>object oViews = nd.Views; object[] oarrViews = (object[])oViews; Dictionary&lt;string, List&lt;string&gt;&gt; folderDict = new Dictionary&lt;string, List&lt;string&gt;&gt;(); for (int x=0; x &lt; oarrViews.Length - 1; x++) { NotesView view = viewArray[x]; if (view.IsFolder) { NotesDocument doc = view.GetFirstDocument(); while (doc != null) { // Populate folderDict Dictionary by setting // document's UNID as Key, and adding folder name to List } } } </code></pre> <p>Then in your loop:</p> <pre><code>//Copy document to second database. NotesDocument ndoc = nd.GetDocumentByUNID(nve.UniversalID); NotesDocument newDoc = ndoc.CopyToDatabase(nd2); if (folderDict.ContainsKey(nve.UniversalID)) { foreach (var folderName in folderDict[nve.UniversalID]) { newDoc.PutInFolder(folderName, true); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload