1

How can I modify PDF document's custom properties (metadata) using VBScript?

Is there a way to utilize iTextSharp from VBScript? Or should I use a different tool? I have tried MS OLE File Property reader :

Option Explicit
Set oFile = CreateObject("DSOFile.OleDocumentProperties")
oFile.Open("C:\Test\312651.pdf")
oFile.CustomProperties.Add "Version", "2.0.0.0"
oFile.Save
oFile.Close

Got an error: ActiveX component cannot create an object 'DSOFile.OleDocumentProperties'

Coding Duchess
  • 6,445
  • 20
  • 113
  • 209
  • Did you download [dsofile.dll](https://support.microsoft.com/en-us/kb/224351) and register it by using `regsvr32 dsofile.dll`? – Helen Apr 20 '15 at 09:22
  • Yes, I did. And I got a message that it registered successfully, so I am puzzled as to why it is not working – Coding Duchess Apr 20 '15 at 13:10
  • Are you on 64-bit Windows? If so, run your script using the 32-bit script host from `C:\windows\syswow64`. – Helen Apr 20 '15 at 16:38
  • Yes, I am on the 64-bit and I tried running my script from C:\Windows\SysWow64 and got the same error – Coding Duchess Apr 20 '15 at 20:41

0 Answers0