Vcl.StdActns.TFileOpenWith.ExecuteTarget

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure ExecuteTarget(Target: TObject); override;

C++

virtual void __fastcall ExecuteTarget(System::TObject* Target);

Properties

Type Visibility Source Unit Parent
procedure
function
public
Vcl.StdActns.pas
Vcl.StdActns.hpp
Vcl.StdActns TFileOpenWith

Description

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

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.

See Also