Transfers a command string from Magic xpa to the DDE server specified by the function's parameters. Each DDE server application provides access to its services via a combination of three identifiers: service, topic, and item. Taken together, the three identifiers provide a unique identification of the service. The command string transferred by Magic xpa will be transferred to the server application, which in turn will try to execute it. The command string must follow strict DDE format rules. The command contents must be a valid server application's command. If the command contents are not a valid server application command, the server application will fail.
|
Syntax:
|
DDExec (service, topic, item, command)
|
Parameters:
|
service: Provides the main identifier of the DDE service. Usually this is an application name such as WinWord, for MS Word for Windows, or Excel, for MS Excel.
|
|
topic: when used with DDExec, the topic will usually be 'System', as the server application, represented by the System topic, rather than a data object within the server application, is responsible for the exchange.
|
|
item: Further defines the exact data item for the exchange. When used with DDExec, it will usually remain empty.
|
|
command: The command string that will be passed by the function to the server application that will then execute it. DDE commands must be contained within square brackets [ ].
|
|
Several commands may be included within one command string, each in its own brackets, separated by blanks.
|
|
For example:
|
|
[command1]
|
|
[command2(parameter1)]
|
|
[command3(parameter1, parameter2, parameter3)]
|
|
[command1] [command3(parameter1, parameter2, parameter3)]
|
|
The command string must contain a valid server application command. Refer to the server application documentation for details about command syntax.
|
Returns:
|
TRUE for successful completion, or FALSE for failure to execute the command at the server application.
|
Examples:
|
DDExec ('WinWord', 'System','','[FileOpen "c:\docs\ddetest.doc"]') Opens an MS Word for Windows document where: '[FileOpen "c:\docs\ddetest.doc"]' is the command transferred by the function to the server application for execution.
|
|
DDExec ('Excel', 'System','','[run("MACROS.XLM!FormatCells")]') Executes the MS Excel macro (FormatCells).
|
|
DDExec ('Excel','System','','[Open("c:\docs\test.xls")]') Executes the MS Excel system.
|
|
Magic xpa requires the single quotes shown in these examples, to identify variables as strings.
|
|
MS Excel requires the double quotes shown in these examples.
|
See also:
|
DDEBegin, DDEEnd, DDERR, DDEGet, DDEPoke
|