Link to home
Start Free TrialLog in
Avatar of jpariso
jpariso

asked on

VBA Code to check Remote Desktop Status

I would like simple VBA code that checks the status of Remote Desktop status on the remote computer FROM the remote computer.

I run an Access Database on the remote computer via a remote desktop connection. I would like the code running on the remote computer to check it's Remote Desktop Status (i.e. is the computer being logged into via remote desktop?) so that I can run different code based on the result...

...Basically, when using remote desktop to run this database I would like the application to use a different set of printers than the ones used physically at the site.  All printing is currently handled through VBA code, so if I can get code for checking Remote Desktop status, then it's just a matter of modifying the current code.
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

That you can control by selecting smart printing on the host and let the users logon with a mark in Resources, Printers. Then the session will use the user's default printer for printing. but its own default printer for a physical user.

/gustav
Avatar of jpariso
jpariso

ASKER

Thanks Gustav for the quick resposne,

but...

I am not looking for a workaround here. The only solution that will be accepted is one that uses vba code.  I don't mind using API calls from the code if need be.

The reason being, specifying printing will not be the only application for this.  There are all kinds of minor functionality issues that can be modified via code if I can establish if the program itself is being run through a remote session.
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jpariso

ASKER

Well that was easy... and so far it works flawlessly!

Thanks for the help!
You are welcome!

/gustav