[Dba-office] Outlook template and macro

Gustav Brock gustav at cactus.dk
Thu Jan 21 10:06:42 CST 2016

Hi Susan

Sloppy means ... all of it. Mix of early and late binding, misleading variable names, badly named functions, declaration As Object where this easily could be narrowed down. Repeated code which can be moved to supporting functions, lousy prompts for the user, no Buttons specified for MsgBox, lack of use of common constants, magic numbers where VBA constants exist, no comments at all, no version information, mixed indenting, etc. 

But it worked. Just not the kind of work I return for money.


-----Oprindelig meddelelse-----
Fra: Dba-office [mailto:dba-office-bounces at databaseadvisors.com] På vegne af Susan Harkins
Sendt: 21. januar 2016 16:54
Til: dba-office at databaseadvisors.com
Emne: Re: [Dba-office] Outlook template and macro

This is definitely good news and like you, I've never found a way to save a modified template. I've researched and left questions - I have no idea how to do it. Maybe you can't. But I'm glad you were able to do this for your client!

BTW, define sloppy -- do you mean shortcuts such as no commenting, no naming conventions, etc. or are you referring to bad code decisions? Just curious. 

Susan H. 

Hi Susan

Job done, happy client, and the links were a good help. Thank you.

The task was from a special received mail to create a respond mail with some extra info (phone number for an SMS gateway). I used an InputBox to get the number, then send the mail silently without displaying it. Thus, I could use the existing template and modify it via code only so, luckily, I didn't have to redesign the template. I haven't found out how to save a modified template, and it is hard to search for solutions because the keywords lead to a bunch of irrelevant results.

I partly had to modify some existing code (not by me) and, once again, it struck me how much sloppy code "programmers" get away with ...


More information about the Dba-office mailing list