Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
How to re-connect using Word Integration
RussWilmott
I am using the iManVBALib.GetBaseObjects to get the IManage.NRTSessions.
However, in the case where Outlook uses Word as its editor, if an email has a Word document attached and that document is opened there is a problem.
The iManO2K.ConnectionMode is nrIndeterminateMode=3 so I need to re-connect Word to the DMS server.
Can you tell me how that is done programmatically?
'***************************************************
'FUNCTION: GetBaseObjects()
'This function gets all the base objects and makes
'them available to other functions
'What it sets up:
' MyExtObj = iManageExtensibility object
' objNRTDMS = NRTDMS object (if in connected mode)
' objSessions = NRTSessions collection (in connected mode)
' objPortableSession = PortableSession object (in portable mode)
' objContext = ContextItems collection (in connected/portable modes)
' objWordApp = Word application application
' objComAddin = Office.COMAddIn object
' lConnectMode = iManO2K.ConnectionMode (the current connection mode)
'Return Values:
' Returns FALSE if error occurred, TRUE otherwise
'***************************************************
Private Function GetBaseObjects() As Boolean
'Get Return Value to False by Default
GetBaseObjects = False
'If Word is already open get the current instance
On Error Resume Next
Set objWordApp = GetObject(, "Word.Application")
If objWordApp Is Nothing Then
'Create an instance of the Word.Application object
Set objWordApp = Word.Application
End If
'Retrieve the iManage COM add-in for Office 2000
'from the Word application object.
Set objCOMAddIn = objWordApp.COMAddIns("iManO2K.AddinForWord2000")
'Retrieve the iManage extensibility object
'from the add-in.
Dim n As Integer
For n = 1 To 10
If Not objCOMAddIn.Object Is Nothing Then
Set MyExtObject = objCOMAddIn.Object
Exit For
End If
Next n
On Error GoTo GetBaseError
If MyExtObject Is Nothing Then
MsgBox "Unable to access iManage."
End If
'Get connection mode
lConnectMode = MyExtObject.CurrentMode
If (lConnectMode = nrConnectedMode) Or (lConnectMode = nrPortableMode) Then
'Get the ContextItems collection
Set objContext = MyExtObject.Context
If objContext Is Nothing Then
MsgBox "Error in GetBaseObjects - objWordApp.COMAddIns(iManO2K.AddinForWord2000).object.context is Nothing."
Else
Select Case lConnectMode
Case Is = nrConnectedMode
'Get the NRTDMS and NRTSessions objects
Set objNRTDMS = objContext.Item("NRTDMS")
Set objSessions = objNRTDMS.Sessions
Case Is = nrPortableMode
Set objPortableSession = objContext.Item("PortableNRTSession")
End Select
End If
Else
MsgBox "ConnectMode is indeterminate"
'RECONNECT HERE
'==============
End If
GetBaseObjects = True
Exit Function
GetBaseError:
MsgBox Err.Description, vbCritical
Err.Clear
End Function
Find more posts tagged with
Comments
jny
This unfortunately is not a problem with the VBA code. But rather, in a situation like this -- where the MS Word editor is turned on -- Office Integration is not snapped on when the WorkSite document is opened from within FileSite.
This is a known issue. One work-around would be to check whether the WorkSite session is connected by adding additional code to check this in your VBA, which is when iManO2K.ConnectionMode returns nrIndeterminateMode. When this value is returned, prompt the user to log on to WorkSite such as by invoking an instance of the LoginCmd Object.
There is a plan for the Office Integration Module (iManO2K.dll) to provide a method for users to re-establish the connection in a future release. ETA unknown at this time.
You may also submit an enhancement request via the Product Enhancement & Feedback Form at
http://worksitesupport.interwoven.com/
, and click on New Feature Request link.