File.Open

File.Open ( 

string Filename,

string WorkingFolder = "",

number WindowMode = SW_SHOWNORMAL )

Example 1

File.Open(SessionVar.Expand("%AppFolder%\\chapter3.rtf"), "", SW_MAXIMIZE);

Opens "chapter3.rtf" located in the user's application folder in the user's default viewer for RTF files (probably Word), and maximizes the viewer program's window.

Note: In order to expand the session variable %AppFolder% in an action, the action SessionVar.Expand must be used.

Example 2

File.Open(_TempFolder.."\\Documents\\readme.txt", "", SW_SHOWNORMAL);

Opens "Documents\readme.txt" (located in the system Temp folder) in the user's default viewer for TXT files (probably Notepad), and opens the viewer program's window normally (not minimized or maximized).

Example 3

File.Open(SessionVar.Expand("%MyDocumentsFolder%\\secretplans.pdf"), SessionVar.Expand("%MyDocumentsFolder%"));

Opens the "secretplans.pdf" file, located in the user's My Documents folder, using the user's default viewer for PDF files (probably Acrobat). Tells the default viewer to use the My Documents folder as the working folder.

Note: In order to expand the session variable %MyDocumentsFolder% in an action, the action SessionVar.Expand must be used. The path to the user's My Documents folder could also be retrieved using the Shell.GetFolder action.

See also:  Related Actions