Private Sub objApplication_DocumentBeforeSave(ByVal Doc As Document, _SaveAsUI As Boolean, Cancel As Boolean) 'Capture the save event to set doc properties when saving a doc. This is'needed to give users a way to update the document id when copying to a new document.Dim objDocument As IManage.IManDocument'Only update properties if we are in connected modeIf objExtensibilitySink.CurrentMode = nrConnectedMode ThenSet objDocument = objExtensibilitySink.GetDocumentFromPath(Doc.FullName)If Not objDocument Is Nothing Then SetDocVars objDocumentEnd IfEnd IfEnd Sub