We're using some VB code (see below) to checkout a Word document, update
some properties and then checkin and publish the document. Everything
is working except the Title and Author properties in the document itself
are not being set. Plex is showing us that the proper WSS properties
are being set but they aren't then being demoted into the Word doc
itself if the corresponding Word field already has a value.
However, if we manually checkout the doc, delete the existing values for
the Title and Author properties in our Word doc, our code works fine
(i.e. all of the properties are being set as we'd expect including the
Title and Author fields).
When we programmatically try to set Title and Author to "" and Save, it
doesn't work ...we see the same problem ... the corresponding WSS
properties are set but they are not being demoted to the Word doc
itself.
We've tested this on two different servers with the same results:
1. W2K Advanced Server + SPS SP1 + Office XP
2. W2L Advanced Server + SPS + Office 2000
Any ideas?
Dim kDoc As New PKMCDO.KnowledgeDocument
Dim kVersion As New PKMCDO.KnowledgeVersion
Dim rs As ADODB.Recordset
Dim sWorkingCopyUrl As String
Set rs = kVersion.Checkout(gc_sWorkspaceUrl +
"/Documents/Gifts/Microsoft Tahoedoc")
sWorkingCopyUrl =
rs.Fields("urn:schemas-microsoft-com:publishing:WorkingCopy")
' look up URL of working copy
kDoc.DataSource.Open sWorkingCopyUrl, , adModeReadWrite
kDoc.ContentClass = gc_DocumentProfile
Dim sDebug as Now(); /* for debugging */
kDoc.Description = sDebug;
kDoc.DataSource.Save
kDoc.Title = sDebug;
kDoc.DataSource.Save
kDoc.Author = sDebug;
kDoc.DataSource.Save
kDoc.Categories = Array(":GRS Summary Sheets", ":GRS Summary
Sheets:First Half")
kDoc.DataSource.Save
kVersion.Checkin (gc_sWorkspaceUrl + "/Documents/Gifts/Microsoft
Tahoe.doc")
kVersion.Publish (gc_sWorkspaceUrl + "/Documents/Gifts/Microsoft
Tahoe.doc")
Set kDoc = Nothing
Set kVersion = Nothing