Microsoft Office Automation using Comate
Posted: Tue May 24, 2016 6:33 pm
I'm having trouble navigating through a Word document using Comate Plus. Everything works fine, except the line noted to scroll down the page. If I record a macro in Word, the VBA code is:
Selection.MoveDown Unit:=wdScreen, Count:=1
I believe the wdScreen value is 7, which I have put in the code.
I've tried Invoke, SetProperty and GetIntegerProperty command variants, but I still can get the thing to scroll down.
Any help much appreciated!
Selection.MoveDown Unit:=wdScreen, Count:=1
I believe the wdScreen value is 7, which I have put in the code.
I've tried Invoke, SetProperty and GetIntegerProperty command variants, but I still can get the thing to scroll down.
Any help much appreciated!
Code: Select all
WordObject = COMate_CreateObject("Word.Application")
If WordObject
Document(Index) = WordObject\GetObjectProperty("Documents\Open('" + FileName + "', #opt, #True)")
If Document(Index)
WordObject\SetProperty("Visible = #True")
WordObject\SetProperty("WindowState = 1") ; Maximize
WordObject\SetProperty("ActiveDocument\Selection\MoveDown(Unit = 7, Count = 1)") ; Does not work
Endif
Endif