Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Custom footer macro for MS Word in Portable mode
fraynie
Hello
I have some code to update the footer with document information (doc no and version no etc). This works great when I am online, but does not work in Portable mode.
I am using the Extensibility sink's OnCreateNewProfile and OnCreateNewVersion events to fire my code, which set up either a SaveAsOptionCmd sink or a NewVersionCmd sink. The relevant PostOnOk event is used to fire the macro that updates my document footer.
I am guessing that in Portable mode I need to use the PostOnOk event of the CheckinPortableCmd object - can anyone confirm this?
Also, when I am in Portable mode the OnCreateNewProfile or OnCreateNewVersion events of the Extensibility Sink object - do not fire. If the CheckinPortableCmd is the right object to use, how can I set up a sink?
I would be very grateful is anyone could help - many thanks.
Here is what I currently have...
Private WithEvents objExtensibilitySink As iManO2K.iManageExtensibility
Private WithEvents objNewVersionCmdSink As IMANEXTLib.NewVersionCmd
Private WithEvents objFileSaveCmdSink As IMANEXTLib.SaveAsOptionCmd
Public Sub SinkIManageExtensibility(objExtensibility As iManO2K.iManageExtensibility)
Set objExtensibilitySink = objExtensibility 'set up during AutoExec
End Sub
Private Sub objExtensibilitySink_OnCreateNewProfile(ByVal objImportCmd As Object)
Set objFileSaveCmdSink = objImportCmd
End Sub
Private Sub objFileSaveCmdSink_PostOnOK(ByVal pMyInterface As Object)
Dim objDocument As IManage.IManDocument
Set objDocument = objFileSaveCmdSink.Context("ImportedDocument")
'Insert footer to our document
FootActiveDocument objDocument
End Sub
Private Sub objExtensibilitySink_OnCreateNewVersion(ByVal objNewVersionCmd As Object)
Dim objDocument As IManage.IManDocument
Set objDocument = objExtensibilitySink.GetDocumentFromPath(Word.ActiveDocument.FullName)
If Not objDocument Is Nothing Then
objDocument.Refresh
End If
'Assigns our NewVersion Command sink so we can capture the events in when creating new versions
Set objNewVersionCmdSink = objNewVersionCmd
End Sub
Private Sub objNewVersionCmdSink_PostOnOK(ByVal pMyInterface As Object)
Dim objDocument As IManage.IManDocument
Set objDocument = objNewVersionCmdSink.Context("IManExt.NewVersionCmd.Document")
'Insert footer to our document
FootActiveDocument objDocument
End Sub
Find more posts tagged with
Comments
There are no comments yet