'Return the current nrtdms object.Function GetNRTDMS() As IManage.NRTDMS Set GetNRTDMS = Nothing Dim objComAddin As Office.COMAddIn Dim objO2KExt As iManO2K.iManageExtensibility Dim pContextItems As IMANEXTLib.ContextItems 'Get the iManO2K add-in from the add-ins collection. Set objComAddin = Application.COMAddIns("iManO2K.AddinForWord2000") If Not objComAddin.Connect Then MsgBox "The iManage add-in isn't enabled", vbOKOnly, "Error in GetNRTDMS()" Exit Function End If 'The objComAddin Object property is the extensibility object. Set objO2KExt = objComAddin.Object Set pContextItems = objO2KExt.Context If pContextItems.Count = 0 Then 'This branch is entered under Word 2007, but not under Word 2003. MsgBox "pContextItems.count should not be 0!", vbOKOnly, "Error in GetNRTDMS()" Exit Function End If Set GetNRTDMS = pContextItems.Item("NRTDMS")End Function 'GetNRTDMS
Isn't the COM integration with Office 2007 only supported for client version 8.2 SP1?
Also I think this may be only supported for the Windows Vista OS, but I may've got my wires crossed there.
Isn't the COM integration with Office 2007 only supported for client version 8.2 SP1? Also I think this may be only supported for the Windows Vista OS, but I may've got my wires crossed there.
The "iManO2k.dot" VBA add-in isn't in itself responsible for the integration with Microsoft Word application. It's there solely to provide integration with shortcut key assignments (KeyBindings) in Word, which can only be assigned to macros. This is a limitation of the Word object model.
The actual COM integration add-in is a compiled library located in the main WorkSite folder. For example, for Office XP & Office 2003 the file responsible is iManOXP.dll
Having said all that.. sorry I can't help with your specific issue!
' Returns the iManage Document object associated with the ActiveWindowPublic Function GetActiveDocument() As NRTDocument Dim objComAddin As Office.COMAddIn Dim objExtensibility As iManO2K.iManageExtensibility On Error GoTo errHandler If Documents.Count = 0 Then 'no documents are open Exit Function End If 'get the iManO2K add-in from the add-ins collection Set objComAddin = Application.COMAddIns("iManO2K.AddinForWord2000") If objComAddin.Connect = False Then 'the iManage add-in isn't enabled Exit Function End If 'the objComAddin Object property is the extensibility object Set objExtensibility = objComAddin.Object If (objExtensibility.CurrentMode = nrConnectedMode) Or (objExtensibility.CurrentMode = nrPortableMode) Then Set GetActiveDocument = objExtensibility.GetDocumentFromPath(ActiveDocument.FullName) End If Set objExtensibility = Nothing Set objComAddin = Nothing Exit FunctionerrHandler: MsgBox Err.Number & vbLf & Err.Description, vbCritical + vbOKOnly, "Create Worksite Document Object" Err.Clear Set objExtensibility = Nothing Set objComAddin = NothingEnd FunctionFunction GetNRTDMS() As IManage.NRTDMS Dim currentDoc As IManage.NRTDocument Set currentDoc = iManInform.GetActiveDocument Set GetNRTDMS = currentDoc.Database.Session.NRTDMS Set currentDoc = NothingEnd Function
In your code, you would now get a handle to the extensibility object through this new name versus the former one, iManO2K.AddinForWord2000, like so:[----snip----]