FORMULA LANGUAGE
Conv_ID := @DDEInitiate("123W";"Budget95.wk3"); @If (@IsError(Conv_ID); @Do(@Prompt([Ok];"Error"; "Unable to initiate conversation");@Return("")); @Do(@DDEPoke(Conv_ID;"A:B6"@Text(Amount)); @DDEExecute(Conv_ID;"[RUN(\"{Goto}A:B6~\")]"); @DDEExecute(Conv_ID;"[RUN(\"/rfc~~\")]"); @DDEExecute(Conv_ID;"[RUN(\"{Goto}A:B10~{EditCopy}\")]"); @DDETerminate(Conv_ID); @Command([EditNextField]); @Command([EditPaste])))
The linebyline explanations:
Conv_ID := @DDEInitiate("123W";"Budget95.wk3");
Initiates a conversation between Domino and 123. This statement specifies which worksheet to use (BUDGET95.WK3) and stores the conversation ID in the variable Conv_ID. Note that the specified file must be open before the @DDEInitiate is executed.
@If (@IsError(Conv_ID); @Do(@Prompt([Ok];"Error"; "Unable to initiate conversation"); @Return(""));
Determines whether the DDE conversation was successfully initiated. If it was, the formula continues; if it wasn't, a message appears, and the formula stops executing.
@Do(@DDEPoke(Conv_ID;"A:B6";@Text(Amount));
Converts the contents of the numeric Amount field to text, and then passes that value to cell A:B6 in the 123 worksheet. The value must be converted to text because only text can be passed via DDEPoke.
@DDEExecute(Conv_ID;"[RUN(\"{Goto}A:B6~\")]");
Makes cell A:B6 the current location in the worksheet.
@DDEExecute(Conv_ID;"[RUN(\"/rfc~~\")]");
Passes the Range, Format, Currency command to 123; cell A:B6 is now formatted for currency values.
@DDEExecute(Conv_ID;"[RUN(\"{Goto}A:B10~{EditCopy}\")]");
Passes the Goto and Edit Copy commands to 123; cursor is moved to cell A:B10 within the worksheet and the value stored in that cell is copied to the Windows Clipboard.
@DDETerminate(Conv_ID);
Terminates the DDE conversation.
@Command([EditNextField]);
Navigates to the next field within the current Domino document.
@Command([EditPaste])))
The contents of the Clipboard (the value from cell A:B10) are pasted into that field.
See Also