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)
Attribute setting not recognised by New Version
pennyg
I have a piece of VBA in Word which updates the Document Description field with data entered by the user into a form. Basically the following lines:
'Try to set document attribute
ppDoc.SetAttributeValueByID nrDescription, docDesc
ppDoc.UpdateProfile vErrs 'Try to save changes
ppDoc of type IManage.NRTDocument
This appears to work perfectly. If I look at the WorkSite Properties on the document from within Word it shows the updated description however when the User selects Save As New Version the original description is displayed and not the updated one. I've tried a ppDoc.refresh but that doesn't help. Saving the document first doesn't help. If the user goes into WorkSite Properties and clicks save then New Version is fine.
Any suggestions.
P.
Find more posts tagged with
Comments
Migrateduser
Strange, but this could be the result of how Word holds documents open while in use. The Save As New Version command may be using data actually pulled back from the server. You may have to force a "post" of your changed profile information back to the server by checking the document in, then checking it out again, since I assume you want to have it in use after your profile edit...
jny
The profile changes you've made on the original WorkSite document object is not made to the associated PRF file (in the portable directory). The PRF, which retains the metadata when the WorkSite document is opened on the client-side is not synched with the new changes until the document file is closed; this is when Office Integration uploads the opened file back into WorkSite and update any profile changes.
You would need to catch the NewVersionDlg_OnInitDialog event to update the New Version Profile dialog with the new description. Like so:
Private WithEvents objNewVersionCmdSink As IMANEXTLib.NewVersionCmd
Private WithEvents objNewVersionDlgSink As IMANEXTLib.NewVersionDlg
Private Sub objExtensibilitySink_OnCreateNewVersion( _
ByVal objNewVersionCmd As Object)
Set objNewVersionCmdSink = objNewVersionCmd
End Sub
Private Sub objNewVersionCmdSink_OnInitDialog(ByVal pMyInterface As Object)
Set objNewVersionDlgSink = pMyInterface
End Sub
Private Sub objNewVersionDlgSink_OnOK(ByVal pMyInterface As Object)
Dim objDocument As NRTDocument
Set objDocument = _
objExtensibilitySink.GetDocumentFromPath(Word.ActiveDocument.FullName)
If Not objDocument Is Nothing Then
objDocument.Refresh
objNewVersionDlgSink.SetAttributeValueByID nrDescription, objDocument.Description, True
End If
End Sub