Download - Macro

Transcript
Page 1: Macro

Macro

Edward Kwang

President

Page 2: Macro

Internal and External Macro

• Internal Macro is used to automate task inside Elliott

• External Macro is used to communicate with other Windows application for automation

• They are both keystroke based – any users can learn how to use it.

Page 3: Macro

Demo of an Internal Macro

• Print an Aging Report by Customer– Show “Detail”

– Show Customer Owe More Than $100 That’s Past Due

– Show the Open Item Only

• Develop a Macro that always supplies the same parameters.

Page 4: Macro

Designing an Internal Macro• Locate the field where you want to execute the

macro.

• Write down the keystrokes you want to automate on a piece of paper and simulate the process.

• Go back to the original field, then click “Macro” tool bar button (look like a Gear).– Choose “Internal” tab

– Click “New” button

– Enter the Macro name and click “OK”

– Go down to the 1st line of [Script] section and start to enter the keystrokes.

Page 5: Macro

Execute Macro inside Elliott

• A predefined Internal Macro is only valid at the specific field of a screen. (Why?)

• Script Syntax:– “XYZ” = means type “XYZ” and hit “Enter”

key.

– {enter} = Enter Key

– ;; = Comments

• Assign Hot Key

Page 6: Macro

Demo {Wait} Syntax

• What if you wish to stop at the middle of the script and prompt user for some value before proceeding?

– For example, different aging date

– Use {Wait}

Page 7: Macro

Demo of Macro Documentation

• Where do you find more information about Macro?

– From the workstation where you install Elliott. Choose “Start” -> “Programs” -> “Elliott 7” -> “System Manager” (Require Acrobat Reader)

– Browse to C:\ELLIOTT7\DOC\SM.PDF

Page 8: Macro

Internal Macro Applications

• Automate Repeating Keystrokes – Based on your operation procedure, certain fields will always be entered certain ways:

– Run an report

– Add a customer

– Add an item

– Data Entry

Page 9: Macro

Demo Command Prompt Macro

• Startup Elliott and go directly to A/R Aging Report by Customer Number

– Choose “Detail”

– Allow to {Wait} for Aging Date

– Show Open Item Only

– Default all other fields {enter}

• Bring up the Print Option Screen

– Send to Disk

Page 10: Macro

Folder for Command Macro

• Create a folder on your desktop to store the command prompt macro

• Let’s name the folder “Month End”

• Create a short cut in the folder by using right click

• Enter the startup command as– m:\elliott7\el700 02 0401 0101

– Name the short cut as “Aging Report”

Page 11: Macro

Command Macro Syntax• The first parameters determine which module

– 01 = GL

– 02 = AR

– 03 = AP

– 04 = PR

– 05 = BB

– 06 = IM

– 07 = COP

– 08 = PO

– 09 = BOMP

– …etc.

Page 12: Macro

Command Macro Syntax

• 2nd Parameter (0401) is for Menu Choice

– 04 means the 4th menu item

• 01 = Maintenance

• 02 = Inquiry

• 03 = Processing

• 04 = Reports

• …etc.

– 01 means the 1st drop down item

• 01 = Aging Reports

• 02 = Commission Due Reports

• …etc.

Page 13: Macro

Command Macro Syntax

• 3rd Parameter (0101) is for menu choice

– The first 01 means the first menu item “Print”

– The 2nd 01 means the first drop down menu item “By Customer Number”

Page 14: Macro

Run Aging Report Automatically

• Modify the “Aging Report” short cut and change the command as:

m:\elliott7\el700 02 0401 0101 “D” ~ ~ {wait} ~ ~ ~ ~ “Y” ~ ~ ~ %d

• “D” = Change the default “S” (Summary) to “D” (Detail)

• ~ = Enter (same as {enter}, ~ is the abbrev. form)

• {wait} = will wait for the aging date field

• “Y” = Change the default value “Show Open Item Only” to “Y”

• %d = Alt-d (% = Alt key) which means print to Disk in the Print Option window.

Page 15: Macro

Command Macro Limitation

• 256 Bytes Command Prompt Limit with Certain O/S

– Can’t write complicate macro with 256 bytes

• Use the file option if you need to run a complicated macro:

– el700 02 /f:aging.mac

Page 16: Macro

Run Command Macro from a file

• Create a Macro File “aging.mac” with notepad in \elliott7\macro (the default directory)

• Put the following content in this file

0401 0101 “D” ~ ~ {wait} ~ ~ ~ ~ “Y” ~ ~ ~ %d

• Either one line or multiple lines will be fine. Save the file.

• Change the startup command as:– EL700 02 /F:AGING

• The extension can be omitted if you use .MAC as extension.

• The file path can be omitted if you store in the default Macro directory.

• You can’t omit the module number in command prompt.

Page 17: Macro

Command Macro Applications

• Setup Procedure of Doing Routine Tasks

– Month End Procedure

– Daily Procedure

• Bypass User Name and Password

– Have one Elliott session open

Page 18: Macro

External Macro

• Leverage other Windows application to do the job

• Unlike Internal Macro, External Macro is not field sensitive

• External Macro is screen sensitive

• As long as you know the keystroke for use an Window application, you can control it from Elliott

• Information that send to the other window application must present on the current screen.

Page 19: Macro

Demo Customer Welcome Letter• Bring up a customer record in customer change and Click

on the Macro

• In External Macro tab, highlight the “Customer Welcome Letter” (This is the default macro distribute with Elliott V7)

• It might not work depends on two factors:

– Where you install Elliott (default assumption c:\elliott7)

– What is the version of your O/S (default assume 95/98/me)

• Verify the directory where Notepad is installed and what is setup in the default Macro.

• Verify the Scripts where it bring up file “Welcome.txt”

Page 20: Macro

Run Welcome Letter - Notepad

• Run from the “ARCUSMNT” screen

– Not field sensitive

– It is screen sensitive

– Assign Hot Key

• Problem with Notepad

– System Date

– Font

Page 21: Macro

Welcome Letter – MS Word

• Use Welcome.txt as a basis and create Welcome.doc in your Elliott directory.– Date issue (Use Date Field in Word)

– Change to proportional spacing font (Times New Roman)

• Create a new External Macro

• Browse to the directory you can find Microsoft Word:– c:\program files\microsoft office\office10

– This directory for Office XP. If you use a different version of MS Office, then it will be in a different directory. Therefore, this Macro is Office version dependent. You can not run this Macro with, say, Word 2000.

• Choose winword.exe

• Caption is important! Find out the name of your application that will always show up on the title bar (in this case “Microsoft Word”)

Page 22: Macro

Capture Fields in Macro

• Go to specific field

– Click “Add Fields” on “Macro” popup menu

– Accept the default value for field name, Row, Column and Length. Click OK

– Repeat this until you capture all the fields you need.

Page 23: Macro

Writing Scripts in Macro

• Click on the “Script” Button on “Macro” popup menu.

• Go to the first line of [Script] section and put down the following lines:%fo

c:\elliott7\welcome.doc{enter}

{down 4}

Attn: @@Contact@@{enter}

@@Corresp-Name@@{enter}

@@Address-1@@ @@Address-2@@{enter}

@@City@@, @@State@@ @@Zip-Code@@{enter}

Page 24: Macro

External Macro Scripts Syntax

• Similar to Internal. Please reference SM.PDF in c:\elliott7\doc for details.

• %fo means Alt-F O (File Open)

• At this moment the file dialog box should open and system is prompting for the file path and name.

• c:\elliott7\welcome.doc{enter} will supply the file path and name, plus an “enter” key for the default action which is “Open button”.

Page 25: Macro

External Macro Scripts Syntax

• {down 4} will bring the cursor down to the position where the name and address should be populated.

• Attn: @@Contact@@{enter} will first put “Attn: “ on the line and system take the field name “Contact” and substitute its value and append it after “Attn: “. The system issue an {enter} key to advance to the next line.

Page 26: Macro

External Macro Scripts Syntax

• @@Corresp-Name@@{enter} will put the company name at the current position and issue an {enter} key.

• @@Address-1@@ @@Address-2@@{enter} will combine Address-1 and Address-2 at the same line – The reason is in many cases Address-2 is blank and

we do not want to display a blank Address-2 on a separate line.

• @@City@@, @@State@@ @@Zip-Code@@{enter} will put the City, St Zip in the correct format.

Page 27: Macro

Save the Macro

• Exit Notepad and Answer “Yes” to save the file.

• Click “Done” on the “Macro” popup menu to finish the Macro definition.

Page 28: Macro

Test the Macro• Bring up customer record and click on “Macro”

button. Highlight the Macro we just created and choose “Step”.

• Check if there’s any error. If error found, cancel “Step” and fix the macro by using “Edit” -> “Script”

• When all errors are cleared, choose to “Walk” which is a slow animation mode.

• Once “Walk” is working. You can choose to “Run”.

• Assign Hot Key in Properties if necessary.

Page 29: Macro

Print Envelop Macro

• Use the following scripts:%tee

%e

%d

Attn: @@Contact@@{enter}

@@Corresp-Name@@{enter}

@@Address-1@@ @@Address-2@@{enter}

@@City@@, @@State@@ @@Zip-Code@@{enter}

@@Country@@

• %tee means Alt-T E E (Tool -> Letter and Mailing -> Envelop and Letter

• %e for Envelop Tab

• %d for putting cursor in “Delivery address” text box

Page 30: Macro

Excel Customer List Macro• Create an Excel Spread Sheet with the following columns:

– Company Name

– Address 1

– Address 2

– City

– State

– Zip Code

– Contact

– Date

• Save it as “Customer.xls” in c:\elliott7.

• Use it for Mail Merge (Batch) at the end of a day.

Page 31: Macro

Excel Customer List Macro• Use the following Scripts:

%fo

m:\nsi\customer.xls{enter}

^{end}

{home}

{down}

@@Corresp-Name@@{right}

@@Address-1@@{right}

@@Address-2@@{right}

@@City@@{right}

@@State@@{right}

=TODAY(){right}

• ^{end} means CTRL-End (Bring to the end of the spreadsheet)

• {home} means the Home Key and will bring to the first cell of the current row

• {down} will bring to the next cell to start entering data on a new row

Page 32: Macro

Phone Dialer Macro

• Call the customer phone number by using the modem that connect to your phone.

• Many CRM software come with a dialer to perform this kind of function.

• In Elliott, you can use Macro to achieve the same functionality by utilizing Windows default Phone Dialer.

Page 33: Macro

Find out Where is Phone Dialer

• Start -> Programs -> Accessories -> Communication -> Phone Dialer

• Right Click on “Phone Dialer” and choose “Properties”. It will show the location of phone dialer:

C:\Program Files\Windows NT\dialer.exe

• Different version of Windows O/S maybe place dialer.exe in different directory.

• Therefore, this Macro is O/S dependent

Page 34: Macro

Dial a Phone from Sales Desk• Configure your Sales Desk to display phone

number after entering customer number.

• Phone Number is a display field so you need to figure out its position manually.

• Find the first field that you can “Add Field”.

• Use that field’s position to figure out the Phone Number position.

• Verify if your position is correct by choosing “Step” when test the Macro.

Page 35: Macro

Dial a Phone Scripts• Use the following Scripts for Sales Desk

%pi

@@PhoneNo@@

%p

{enter}

• %pi means Alt-P I (Phone Dial)

• %p to ensure the “Phone Number” is selected (Not the Internet)

• Keep in mind this Macro will only work in Sales Desk.

• If you wish to have “Dial a Phone” macro in Customer file maintenance, you need to develop another macro.– External Macro is screen dependent

Page 36: Macro

Handling O/S and App Version

• The Macro you developed might only work for certain O/S or Application Software (MS Office)– Due to the EXE is placed in different directory.

• Standardize your O/S and Application version will help.

• Create different Macro directory for different O/S or Application version.– Click “Setup Preference” button on Tool Bar

– Choose “Misc” Tab

– Change the default Macro directory• i.e. “{Default}\OffxpW2K”

Page 37: Macro

Best Practice for Macro

• Keep your Windows O/S & MS Office version consistent will help to share Macros.

• Close External Application When Done.

– Elliott External Macro can’t deal with the application program if it has been opened already.

• Assign Hot Key consistently through out.

– For example, if you pick Alt-D for dial a phone macro. Then use Alt-D for dial a phone macro in all screen.

– Inconsistent hot key assignment will confuse users.

Page 38: Macro

Conclusion

• Anybody can write Macro in Elliott

– You just need to know the Keystrokes for how to use Elliott or external Application.

• Reference System Manager document for detail information

– C:\elliott7\doc\sm.pdf

• Use your imagination.

Page 39: Macro

Questions & Answers