Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB to Open and Display a set files and applications

Status
Not open for further replies.

Walter349

Technical User
Aug 16, 2002
250
BE
I have a set routine in the mornings that require me to open Outlook, An excel file, a command window, a Folder and a Email template kept in a seperate folder.

What I am looking for is a script to open and display these in an organised manner across the screen.

Outlook and the excel file take up the rightmost two thirds of the screen in equal spacing top to bottom and the other three take the last lefthand third in equal spacing from top to bottom.

Does anyone have a script or ideas on how to do that?

'If at first you don't succeed, then your hammer is below specifications'
 
A script file can open the files and programs that you desire, but there is no way to specify window size and/or position. There is an option to use the size/position the window last used. If you arrange the windows manually and close them down, the script may be able to restore what you had.

Here's a quick example:
Code:
option explicit

Dim WshShell

Set WshShell = CreateObject("WScript.Shell")
'window option '4' specifies the most recently used size/position
WshShell.Run "%windir%\notepad", 4, False
WshShell.Run "C:\temp\Excel_File.xls", 4, False
WshShell.Run "cmd", 4, False
 
Thanks for the suggestion, I have tried it and received a Wsh Error 'the system cannot find the file specified'.
This is when I try to open outlook or the C:\temp folder. The CMD opens, but not in the same position or size, as when previously closed.

Code:
option explicit

Dim WshShell

Set WshShell = CreateObject("WScript.Shell")
'window option '4' specifies the most recently used size/position
WshShell.Run "%windir%\outlook", 4, False
WshShell.Run "C:\temp\Excel_File.xls", 4, False
WshShell.Run "cmd", 4, False

Also I have an oft file for a default outlook template, located on the desktop, how would I go about including that in the script?

'If at first you don't succeed, then your hammer is below specifications'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top