Following is my code in Excel VBA, but there is an error: "Run-time error '438': Object doesn't support this property of method":
Dim app As Object, avdoc As Object, jso As Object, pageview As Object
Set app = CreateObject("AcroExch.App")
Set avdoc = app.GetActiveDoc
Set jso = avdoc.GetJSObject
If avdoc.dynamicXFAForm = True Then
jso.console.println ("This is a dynamic XML form.")
The method GetJSObject is only available for a PDDoc, you need to get the corresponding PDDoc for your AVDoc and then get the JSObject.