RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TFileOpenWith.ExecuteTarget Method

Displays the Open With dialog and then opens a file with the application the user selects.

Pascal
procedure ExecuteTarget(Target: TObject); override;
C++
virtual __fastcall ExecuteTarget(TObject * Target);

This method is called automatically when the action fires in response to a user action (for example, when the user selects a menu item or presses a tool button that is linked to this action). 

Target is the currently active object when the action fires. 

ExecuteTarget ignores the Target parameter and does the following: 

 

  1. If the FileName property is not set, it displays the Open dialog (specified by the Dialog property) to let the user select a file to open. 

  2. If it displays the Open dialog, it generates an OnAccept or OnCancel event, depending on whether the user exited the Open dialog by clicking OK or Cancel. 

  3. It displays the Open With dialog for the user to choose an application with which to view the file specified by FileName or selected in the Open dialog. 

  4. It launches the selected application, displaying the specified File.

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!