X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Trouble With Shell Command, Access 2016    
post Aug 17 2019, 10:13 AM

Posts: 1
Joined: 30-July 19

I'm using the Shell command to open a PDF in Foxit. (Acrobat doesn't fully support opening a PDF to a given page via command line.) The PDF opens correctly to the right page. The problem is that Foxit ignores the "NoFocus" option.

As a workaround, I added the additional line to activate Access. This works 90% of the time - unless the user happened to press a keystroke during the moment that Foxit had the focus. Then the focus gets stuck on the Foxit app. I tried using a timer event to check if Foxit still had focus and switch it back to Access, but once a key has been pressed in Foxit, the AppActivate command won't return the focus to Access.

Can anyone suggest a more foolproof way to open the PDF without giving it the opportunity to grab the focus?

Thank you,

str = "C:\FoxitPhantomPDF.exe C:\MyDocument.pdf /A page=22"
X = Shell(str, vbNormalNoFocus)
AppActivate "Access", False

This post has been edited by EvanScamman: Aug 17 2019, 10:14 AM
Go to the top of the page
post Aug 17 2019, 11:24 AM

UA Moderator
Posts: 76,799
Joined: 19-June 07
From: SunnySandyEggo

Hi. Welcome to UA! welcome2UA.gif

Have you seen this? Hope it helps...

Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    5th December 2019 - 06:00 PM