MS office Need to change author of file to Users NT ID
Hi,
I need to create a package which changes the Author field of Word, Excel and Powerpoint file to the user logged into to the computer. I checked the registry and seems like the key is encrypted.
Any suggestions?
I need to create a package which changes the Author field of Word, Excel and Powerpoint file to the user logged into to the computer. I checked the registry and seems like the key is encrypted.
Any suggestions?
0 Comments
[ - ] Hide Comments

so that the conversation will remain readable.
Answer this question
or Comment on this question for clarity
Answers
Hi Arjun:
Well I could not find a way to do this thru Registry however you could do this by registering a dsofile.dll which can be downloaded from the internet Click Here to download DSO file and then using this vbscript to change any office document properties:
Dim strFile, objFilePropReader, objDocProp
Dim strName, strAppName, strTitle, strAuthor, strComments, strWordCount
strFile = "C:\scripts\Test file.doc"
Set objFilePropReader = CreateObject("DSOleFile.PropertyReader")
Set objDocProp = objFilePropReader.GetDocumentProperties(strFile)
strName = objDocProp.Name
strAppName = objDocProp.AppName
strTitle = objDocProp.Title
strAuthor = objDocProp.Author
strComments = objDocProp.Comments
strWordCount = objDocProp.WordCount
objDocProp.CustomProperties.Add "TestProp", "Test Prop Value"
MsgBox strName & vbCrLf & strAppName & vbCrLf & strTitle & vbCrLf & strAuthor & vbCrLf & strComments & vbCrLf & strWordCount
For Each objCustProp In objDocProp.CustomProperties
MsgBox objCustProp.Name & ": " & CStr(objCustProp.Value)
Next
In case should you require any further clarifications regarding the same kindly revert back.
Well I could not find a way to do this thru Registry however you could do this by registering a dsofile.dll which can be downloaded from the internet Click Here to download DSO file and then using this vbscript to change any office document properties:
Dim strFile, objFilePropReader, objDocProp
Dim strName, strAppName, strTitle, strAuthor, strComments, strWordCount
strFile = "C:\scripts\Test file.doc"
Set objFilePropReader = CreateObject("DSOleFile.PropertyReader")
Set objDocProp = objFilePropReader.GetDocumentProperties(strFile)
strName = objDocProp.Name
strAppName = objDocProp.AppName
strTitle = objDocProp.Title
strAuthor = objDocProp.Author
strComments = objDocProp.Comments
strWordCount = objDocProp.WordCount
objDocProp.CustomProperties.Add "TestProp", "Test Prop Value"
MsgBox strName & vbCrLf & strAppName & vbCrLf & strTitle & vbCrLf & strAuthor & vbCrLf & strComments & vbCrLf & strWordCount
For Each objCustProp In objDocProp.CustomProperties
MsgBox objCustProp.Name & ": " & CStr(objCustProp.Value)
Next
In case should you require any further clarifications regarding the same kindly revert back.
Please log in to comment
Comments