Is it possible to force a Works database file to scroll to the top row when it is opened?

On a Windows 7 platform, I frequently use a Microsoft Works 2000 database file, and there is a minor annoyance with it.  It always opens at the lowest row, requiring scrolling to the top.  If there is a simple way to make it open at the top, I'd like to try that.  I know that this is an obsolete file type, but I'm accustomed to it and comfortable with it, and I'd like to continue using it. The database file can't be attached to this question, but it can be downloaded at www.mauitradewinds.com/test.wdb
LVL 1
ddantesAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NVITEnd-user supportCommented:
Since there's no scriptability in Works, you'd need to go 3rd party. AutoIT should work. You can make a .bat file that...
1. Opens your Works database.
2. Starts the AutoIT script, which does the scroll up.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ddantesAuthor Commented:
Thank you.  May I ask for some specific guidance to implement your instructions?  There are numerous AutoIT downloads -- which one is required?  Can you provide the code for the scroll up script, or will that be accomplished intuitively with the 3rd party application?  Can you provide code for the .bat file?   I apologize for my lack of expertise in this area.
NVITEnd-user supportCommented:
AutoIt Full Installation https://www.autoitscript.com/site/autoit/downloads/

Make a .au3 file of this code:
Adjust these:
- "Database main window title", "sub window title"
- CTRL-HOME is the keyboard sequence to scroll to the top.

See AutoIT help on SEND and WinWaitActive functions.

WinWaitActive("Database main window title", "sub window title")
Send("^{HOME}")

Open in new window


Assuming Works can open the database file (.wdb) from the command line, your .bat would look like:
"C:\Program Files (x86)\Microsoft Works\WksDb" "c:\folder\filename.wdb"
"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "c:\folder\scroll.au3"

Open in new window

Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

ddantesAuthor Commented:
Thank you for your specifications.  I downloaded the full installation.  If I understand correctly, I need to make a au3 file (scroll.au3) from the first two lines of code which you kindly provided.   The .bat file will then launch the database and activate the scroll.au3 file.  

 I am still unclear how to adjust the "Database main window title" and "sub window title".  Can you clarify that please?   I used the Finder Tool and was able to identify the main window title.  I don't see information about a sub window title in the AutoIT Window Information Tool.  The .bat file opens the Works database OK, but it does not scroll to the top.
ddantesAuthor Commented:
Another observation:  the "Home" key on the keyboard does not necessarily cause the database to scroll to the top.  Instead, it scrolls to the last cell which was highlighted when the file was closed.
NVITEnd-user supportCommented:
Compare the attached image for my case:
WinWaitActive("Microsoft Excel", "09162015.xls")

Open in new window

AutoIT Window
I don't have Works so can't be certain.

If there is no subwindow, then use blank double-quotes. For my case, it would be:
WinWaitActive("Microsoft Excel", "")

Open in new window


> the "Home" key on the keyboard does not necessarily cause the database to scroll to the top
Assuming there is a way to use the keyboard to scroll to the top, you'll have to figure that out. Check the Works help.

Sometimes, programs use the Ctrl-HOME or Ctrl-PgUp key combination, or something like that. IDK what's the key combo for Works, if any.

If there is no key scroll combo, you could resort to using a series of PgUp keys. Of course, if that's a big database, it could be a lot of PgUps!
ddantesAuthor Commented:
Thank you for the example.  I attached a screenshot of the comparable AutoIT Window Information for my application.  The code I'm using in scroll.au3 is:
WinWaitActive("Guest Pocket Cal. 2015-16 - Microsoft Works Database", "")
Send("^{HOME}")

Open in new window


If this looks OK to you, please provide the code for sending two PgUP key strokes, which is sufficient to scroll to the top.AutoIT Window Information
NVITEnd-user supportCommented:
Try it.

> I'll try to find a keyboard solution to make it scroll to the top.
Not sure if you already confirmed that the macro does work. If not, keep it simple for now.
Example: After you normally start Works (w/o the script) and open the database, notice where the cursor is. Is it it a certain cell?

Then, in the au3 script make a simple keyboard move, e.g. 1 cell left or right. This, just to confirm basic functionality.

Close Works.

Then, start it with the .bat/script.

If the simple keyboard command works, get fancier. Spend some time finding out if Works does have a keyboard combo to take it to the top in one crack. If so, that could save you programming time.

I think you get the idea.
ddantesAuthor Commented:
I guess the macro doesn't work.  The file opens, but the SEND command doesn't seem to have an effect.  
WinWaitActive("Guest Pocket Cal. 2015-16 - Microsoft Works Database", "")
Send ("{PGUP}")

Open in new window

 This code does not move the file up at all.
NVITEnd-user supportCommented:
Try putting a SLEEP command before sending the keypress...
WinWaitActive("Guest Pocket Cal. 2015-16 - Microsoft Works Database", "")
; Wait for 2 seconds
Sleep(2000)
Send ("{PGUP}")

Open in new window

NVITEnd-user supportCommented:
Also, in your .bat, reverse the commands. Start autoit first, Works second:

"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "c:\folder\scroll.au3"
"C:\Program Files (x86)\Microsoft Works\WksDb" "c:\folder\filename.wdb"

Open in new window

NVITEnd-user supportCommented:
Also, before starting the .bat, close any prior running AutoIT macros in your taskbar, if any. Right-click the grey AutoIT icon and pick Exit.
ddantesAuthor Commented:
"C:\Program Files\AutoIt3\autoIT3.exe"  "C:\Program Files\AutoIt3\Scripts\scroll.au3"
"C:\Program Files\Works 2000\WksDb.exe" "V:\My Documents\Tradewinds\Guest Pocket Cal. 2015-16.wdb"

Open in new window

  Regardless of which order of code appears in the .bat file, only the first line appears to be executed.  If the Works line is on top, the file opens but does not scroll.  If the AutoIT3 line is on top, the Works file doesn't open.  Either way, only one line appears in the command window.
NVITEnd-user supportCommented:
Sorry. Try this:

start "C:\Program Files\AutoIt3\autoIT3.exe"  "C:\Program Files\AutoIt3\Scripts\scroll.au3"
start "C:\Program Files\Works 2000\WksDb.exe" "V:\My Documents\Tradewinds\Guest Pocket Cal. 2015-16.wdb"

Open in new window

ddantesAuthor Commented:
Both lines of code now appear in the command window, which then closes.  The AutoIT3 window then opens.  Then the database opens, but does not scroll.
ddantesAuthor Commented:
Although I couldn't get this third party application to perform as we had hoped, your instructions solved the issue.  I didn't know I could just tap PgUp  twice, and the cursor would be at the top line of the database.  That's good enough, and thank you!
NVITEnd-user supportCommented:
Glad that works for you... Ddantes
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.