I have an Excel (Office 16) VBA code that opens a CorelDraw document and performs a task based on the orientation of each page in the document. The code is as follows:
Dim app As Object
Dim page As Object
Set app = CreateObject("CorelDRAW.Application")
app.OpenDocument "xxx.pdf"
For Each page In app.ActiveDocument.Pages
If page.Orientation = cdrLandscape Then
...
End If
Next
The code fails to execute the "If" statement, even though I can see the orientation property of the page in the Locals window. What is wrong here? (late binding is a necessary condition in this case)
cdrLandscape
needs to be declared in your code if you're using late binding, or you can substitute the numeric value (1)