ACT! for Windows DDE Macro Language ACT! for Windows has extensive support for DDE (Dynamic Data Exchange). Using a third party macro language such as Word for Windows, Ami Pro, Excel, Lotus 123, and many others, you can write sophisticated macros to drive ACT!. DDE allows you to copy & paste links between ACT! for Windows and a client application such as Word for Windows. However, using the DDEExecute command, you can write macros that allow you to control ACT! as if you were typing into it directly. What follows is a reference to the keywords that you can send to ACT! and an explanation of how these keywords affect ACT!. System Commands Very often, you will want to send instructions to ACT! for Windows. The following commands do just that. Note that these are all "System" commands. A "System" command is a command that is sent to ACT! by opening a channel ACT! system channel as follows: ChanNumAct = DDEInitiate("ACTWIN2", "System") Language Reference Keyword Function NEXTREC Causes ACT! to display the next contact in the current database. PREVREC Causes ACT! to display the previous contact in the current database. SAVE Saves the current database file. SAVEAS (NOT IMPLEMENTED YET) Saves the current database file under a different name. Parameters: filename - Name of the new file. May include the complete path also. overwrite - 1 if you want to overwrite any existing file with the given name, 0 if you want to abort the save if a file with the same name exists. Sample Usage: DDEExecute(ChanNum, "SAVEAS C:\ACTWIN2\DATABASE\TEST.DBF 1") This saves the current database as C:\ACTWIN2\DATABASE\TEST.DBF, overwiting the existing file, if any. LOOKUP Performs a lookup. Parameters: fieldname - Name of the field for the lookup. Valid names are as follows: COMPANY FIRSTNAME LASTNAME CITY STATE ZIP ID/STATUS OTHER * Not supported yet MYRECORD EVERYONE PREVIOUS CUSTOM * Not supported yet PRIORITY KEYWORD data - This is the string that you want to match in the lookup. This field is not used if you are perfoming a lookup on MYRECORD, EVERYONE or PREVIOUS. Sample Usage: DDEExecute(ChanNum, "LOOKUP COMPANY CONTACT") Performs a lookup of all records whose comapny name contains the string "CONTACT". RUN_QUERY (NOT IMPLEMENTED YET) Runs a query file. Parameters: filename - Name of the query file. May include the complete path also. Sample Usage: DDEExecute(ChanNum, "RUN_QUERY C:\ACTWIN2\QUERIES\QEURY1.QRY") Executes the query specified. FILE_OPEN (NOT IMPLEMENTED YET) Opens a file. Parameters: filename - Name of the database file. May include the complete path also. Sample Usage: DDEExecute(ChanNum, "FILE_OPEN C:\ACTWIN2\DATABASE\TEST.DBF") GOTO Selects records in the ACT! database. Parameters: FIRSTCONTACT Goto first contact in this group LASTCONTACT Goto last contact in this group FIRST A Goto first contact in group whose company starts with A LAST B Goto last contact in group whose company starts with B NEW_CONTACT Inserts a contact into the database. Parameters: DEFAULT Same as Insert - Default PRIMARY Same as Insert - Primary ALL Same as Insert - All System Requests For some tasks, you need to get information from ACT! for Windows. The following commands do just that. Note that these are all "System" commands. A "System" command is a command that is sent to ACT! by opening a channel ACT! as follows: ChanNumAct= DDEInitiate("ACTWIN2", "System") Language Reference Keyword Function TOTAL_CONTACTS Returns the total # of contacts in this database Sample Usage: ChanNumAct = DDEInitiate("ACTWIN2", "System") Total$ = DDERequest$(ChanNumAct, "TOTAL_CONTACTS") Total = Val(Total$) DDETerminate(ChanNumAct) TOTAL_GROUP Returns the total number of contacts in this group. Sample Usage: ChanNumAct = DDEInitiate("ACTWIN2", "System") Total$ = DDERequest$(ChanNumAct, "TOTAL_GROUP") Total = Val(Total$) DDETerminate(ChanNumAct) CURRENT_CONTACT Returns the total number of contacts in this group. Sample Usage: ChanNumAct = DDEInitiate("ACTWIN2", "System") Total$ = DDERequest$(ChanNumAct, "CURRENT_CONTACT") Total =Val(Total$) DDETerminate(ChanNumAct) GET_DB_FILE (NOT IMPLEMENTED YET) Returns the file name of the current ACT! database. Sample Usage: ChanNumAct = DDEInitiate("ACTWIN2", "System") FileName$ = DDERequest$(ChanNumAct, "GET_DB_FILE") DDETerminate(ChanNumAct) GET_NOTES (NOT IMPLEMENTED YET) Returns a string that contains up to the first 64K of notes. Sample Usage: ChanNumAct = DDEInitiate("ACTWIN2", "System") NOTES$ = DDERequest$(ChanNumAct, "GET_NOTES") DDETerminate(ChanNumAct) GET_HISTORY (NOT IMPLEMENTED YET) Returns a string that contains up to the first 64K of history. Sample Usage: ChanNumAct = DDEInitiate("ACTWIN2", "System") HISTORY$ = DDERequest$(ChanNumAct, "GET_HISTORY") DDETerminate(ChanNumAct) Database Commands The ACT! DDE Link lets you access the current contacts information. You must open a channel with a command like the following: ChanNumAct = DDEInitiate("ACTWIN2", "DATABASE") You can then access any of the data fields being sure to use the correct absolute field names. You can only DDEPOKE data onto the current contact screen.