From HotDocs Wiki

(Redirected from UpdateDocument Object)
Jump to: navigation, search


General Information

ProgID: HDNET.UpdateDocument.1
HDNET.UpdateDocument (version-independent)
CLSID: {F669D54B-6B13-4503-98CE-5F29D0678C77}


Method.gifParse(fileName) Opens an existing HotDocs update RSS document (RSS feed).
fileName: A String value, which is the file name and path of an existing update document (RSS feed).
Method.gifSave(fileName) Saves the UpdateDocument to disk.
fileName: A String value, which is the file name and path where the update document (RSS feed) will be saved.
Property.gifchannels Returns the collection of UpdateChannels contained in the UpdateDocument. [Read-only]
CAUTION: Although RSS specifications allow for more than one channel in an RSS feed, HotDocs only recognizes one channel in a HotDocs update RSS document. Therefore, the "collection" returned by this property will normally contain only one channel.

Example Code

Example of Adding a New Update Item to a HotDocs Update RSS Document (Visual C#)
//This example opens an existing RSS document and adds a new update
//item if its guid does not conflict with an existing update item.

HDNETLib.UpdateDocumentClass rss = new HDNETLib.UpdateDocumentClass(); HDNETLib.UpdateItemClass updateItem = new HDNETLib.UpdateItemClass();

//New Update Item updateItem = new HDNETLib.UpdateItemClass(); updateItem.required = true; updateItem.title = "Real Estate Addendum"; updateItem.link = "http://www.HobbleCreek.com/addendum.hdi"; updateItem.description = "This is a revised addendum for Real Estate contracts."; updateItem.guid = "00004"; updateItem.category = "File Update"; updateItem.pubDate = System.DateTime.Now;

//Open the existing RSS document rss.Parse("C:\\example.rss");

//Make sure the new item's GUID does not conflict with an existing item if (rss.channels.Item(0).items.InCollection(updateItem.guid)) { System.Console.WriteLine("Error! An item with the same GUID already exists in the RSS feed."); } else { rss.channels.Item(0).items.Add(updateItem); System.Console.WriteLine("The new update has been added to the RSS feed."); }

//Save the RSS document rss.Save("C:\\example.rss");