I am using the VB editor from MS Access 2003 and I have Adobe 8.0 Installed
I am attempting to convert a 2003 word document to a pdf format using VBA code launched within MS 2003.
I have been using jsOBJECT from within the VB editor to access some of the javascript functionality for modifying and searching pdf documents.
However, I can't figure out the correct syntax for using the openDoc Javascript function within the VB Editor. I am trying to use this openDOC function to convert a word doc into pdf.
Sub Test()
Dim JSO as Object
Set PDDOC = CreateObject("AcroExch.PDDoc")
Set JSO = PDDOC.getjsobject
'what do I do next?
' I tried JSO.openDOC("C:\test.doc")
'this doesn't work
end sub
Thanks,
However, it doesn't give you everything you need and there's no way to declare a JsObject so that you can get Intellisense to help you out.
It's a little querky, but in order for your procedure to work, you first have to declare an Acrobat.AcroPDDoc object, use the CreateObject statement to instantiate it, and then open an existing document before you can use the GetJsObject method to return a JsObject reference.
Dim PDDOC as Acrobat.AcroPDDoc
Set PDDOC = CreateObject("AcroExch.PDDoc")
PDDOC.Open "c:\filename.pdf"
Dim JSO as Object
Set JSO = PDDOC.GetJsObject()
JSO.OpenDoc("C:\test.doc")