Home
TeamSite
How to integrate worksite with VBA?
saranyarajgopal
Hi,
I want to integrate the FileOpen Macro of Word VBA with Worksite FileOpen?
For example when i click on File->Open in imanage it should trigger the macro FileOpen in my template . So that i can write my codes inside the method to use imanage properties.
Any suggestions? Thanks in advance.
Find more posts tagged with
Comments
rathna
Steps to integrate Word with Worksite:
1.create a module(.bas) in your VBProject.
a.Inside the module call the following method ,it will invoke at that time of opening the word application.
'Class Module Name 'SinkObject'
Private objSinkObject As SinkObject
Public Sub AutoExec()
Dim objIManageExtensibility As iManO2K.iManageExtensibility
'For MSoffice 2000/2003 use registry key value "iManO2K.AddinForWord2000"
'For MSoffice 2007 use registry key value "oUTR02K.Connect"
Set objIManageExtensibility =Application.COMAddIns("oUTR02K.Connect").Object
' Set up a sink to the extensibility object.
Set objSinkObject = New SinkObject
objSinkObject.SinkIManageExtensibility objIManageExtensibility
End Sub
--------------------------------------------------------------------------
2.Create Class module(SinkObject.cls) in your VBProject
Option Explicit
Private WithEvents objExtensibilitySink As iManO2K.iManageExtensibility
Private WithEvents objApplication As Word.Application
Private Sub objApplication_DocumentOpen(ByVal Doc As Document)
Dim objDocument As IManage.NRTDocument
Set objDocument = objExtensibilitySink.GetDocumentFromPath(Doc.FullName)
If Not objDocument Is Nothing Then
'Write your custom code here(objDocument is used to retrieve the opened document properties.)
Set objDocument = Nothing
End If
End Sub
-------------------------------------------------------------------------
Try it out.
saranyarajgopal
Thanks for you comments.
What i would actually want is a VBA code that will help me to show worksite open dialog box so that i can link the code to a toolbar button/custom button.