Ask the Expert

API won't recognize double quotes as binder categorizers

Hi, I'm using the Domino.doc 3.5 API to load the Domino.doc layout into a VB app. The problem is that because we use a "" in the BinderCategory to subcategorize binders, I cannot pick it up using the API. The code works perfectly for binders without subcategories.

If you can help it would be much appreciated and I will be even more impressed!

Here's the code:

 

 For iBinders = 0 To
(theRooms.ItemByTitle
(cmbRooms.Text).Cabinets.ItemByTitle
(cmbFileCabinets.Text).Categories
.ItemByTitle
(cmbBinderCategory.Text).Binders.Count - 1)
cmbBinders.AddItem theRooms.ItemByTitle
(cmbRooms.Text).Cabinets.ItemByTitle
(cmbFileCabinets.Text).Categories
.ItemByTitle
(cmbBinderCategory.Text).Binders.ItemByIndex(iBinders).Title, iBinders
Next iBinders


I don't have any experience with the Domino.doc API, so I consulted with our colleague, John Marshall of SwapCode fame. Here's John's reply:

I finally realized what the code was doing after giving myself a brief headache. I presume the SearchDomino.com member is adding the category to a Tree view node or list box. I am not surprised they are having trouble with categories. The Categories, Category objects are among the most poorly documented and confusing objects in the Domino.doc API. Some of the documentation is just plain wrong and in the older versions of the Domino.doc enabler the software did not work at all or as expected.

I have dug out an example of retrieving subcategories using VBScript, which can be easily converted to VB. The page points to an example (ddcReporter) I was developing on how to access the Domino.Doc using the API via a browser. The VBScript is a little crude but fairly clear to read if you take out all the HTML creation lines.

 

Note from Brian: The VBScript John is referring to in this last paragraph can be seen by viewing the source code of the displayed page. Choose View Source from your browser menu and look for the code within the tag "script type="text/vbscript")

There are two methods depending on were you get the Categories object, which can be at Cabinet level and Binder Level.

The Binder level method is the simplest and involves testing for the HasParentCategory property and retrieving it and then its parent then the parent of the parent, etc. Working upwards to construct the subcategories.

The Cabinet level method is more complex and involves iterating through Categories in a Category then iterating through the Categories of each Category of the previous Category etc. Working downwards to construct the subcategories.

OK, it's about as clear as mud. So the easiest way is just to look at the VBScript example page and see what you can use.

 

  1. A library of LotusScript DD API functions most of which can be converted to VB -> ddcAPI
  2. A practical example of the use of the API Library -> ddcImporter
  3. There are API examples in my forum.
-- John Marshall


This was first published in August 2003

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: