' Copyright (c) 2021 ActivePDF, Inc. ' ActivePDF Toolkit 2018 ' Example generated 03/05/21 Dim FSO, strPath, intOpenInputFile, strPropertyValue ' Get current path Set FSO = CreateObject("Scripting.FileSystemObject") strPath = FSO.GetFile(Wscript.ScriptFullName).ParentFolder & "\" Set FSO = Nothing ' Instantiate Object Set oTK = CreateObject("APToolkit.Object") ' Open the PDF to read from intOpenInputFile = oTK.OpenInputFile(strPath & "XMPproperties.pdf") If intOpenInputFile <> 0 Then ErrorHandler "OpenInputFile", intOpenInputFile End If ' Get the reference to the XMP object Set oXMP = oTK.GetXMPManager() ' Get a document property strPropertyValue = oXMP.GetDocumentProperty(2) Wscript.Echo(strPropertyValue) ' Get a custom property strPropertyValue = oXMP.GetCustomProperty("example") Wscript.Echo(strPropertyValue) ' Set the namespace for the user property oXMP.SetNamespace "dc", "http://purl.org/dc/elements/1.1/" ' Get a user property strPropertyValue = oXMP.GetUserProperty("contributor") Wscript.Echo(strPropertyValue) ' Release Object Set oXMP = Nothing ' Close the input file oTK.CloseInputFile ' Release Object Set oTK = Nothing ' Process Complete Wscript.Echo("Done!") ' Error Handling Sub ErrorHandler(method, outputCode) Wscript.Echo("Error in " & method & ": " & outputCode) End Sub