title: Programatically add document to Hummingbird/OpenText eDocs database
body: <p>I am working with the the (formerly Hummingbird Enterprise) OpenText eDocs document management system.</p>
  
  <p><a href="http://www.opentext.com/2/global/products/products-opentext-edocs-products/products-opentext-edocs-document-management.htm" rel="nofollow">http://www.opentext.com/2/global/products/products-opentext-edocs-products/products-opentext-edocs-document-management.htm</a></p>
  
  <p>We are still using Hummingbird 5.1.0.5.</p>
  
  <p>I have been reviewing the API docs for this software, but some areas are slightly vague.
  So far, I can create my Profile form, populate some values.</p>
  
  <pre><code>DOCSObjects.Application docApp = null;
  DOCSObjects.IProfile profile = null;
  Type fType = Type.GetTypeFromProgID("DOCSObjects.Application");
  docApp = (DOCSObjects.Application)Activator.CreateInstance(fType);
  try { profile = docApp.CurrentLibrary.CreateProfile("DEF_PROF"); }
  catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); }
  if (profile != null)
  {
      try
      {
          profile.Columns["DOCNAME"].Value = "New PDF Document";
          profile.Columns["APP_ID"].Value = "ACROBAT";
          profile.ShowProfile(1);
          // not sure how to set a document here
          profile.SetDocument(docApp.CurrentLibrary.Name, document);
          profile.Save(); // requires a short flag, but what?
      }
      catch (Exception ex)
      {
          System.Diagnostics.Debug.WriteLine(ex.Message);
      }
  }
  else
  {
      MessageBox.Show("Profile is null");
  }
  </code></pre>
  
  <p>Where I am having trouble is how to save a document with the profile.
  I am using C# and the API docs and intellisense simply ask for on object for the document.
  Does that mean the path or do I need to load the PDF into some specific DOCSObjects type?</p>
  
  <p>Also, the API docs references a Constant such as OF_NORMAL when saving the document. I assume this is 0, but are there others I should know about? There are many Constants referenced in the docs that have no values defined. (All examples are in C++/VB).</p>
  
  <p>I know it's a long shot anyone is using this software, but thought I would give it a try.
  Thank you and any assistance is appreciated.</p>