This is the Restrict tag.

VBA icon

Restricting character input in a textbox on a userform

One of my pet peeves is intrusive VBA code that interrupts workflow. The problem usually goes something like this:

I have an application/workbook that relies on certain user input data. I have a textbox/cell and I only want certain characters to be allowed. (list of characters follows) How can I accomplish this?

The answer usually involves some version of Worksheet_Change or KeyPress events that detect the input characters and act accordingly.

Continue Reading »

Outlook icon

More Outlook.Application Best Practices

On his blog Le Café Central de DeVa, blogger Deva Gnanam has more sample code for automating Outlook using VBA and the OOM (Outlook Object Model). In his latest post, Using Restrict method to get contacts based on specific categories, he shows us how to use the Restrict Method to filter a collection of ContactItems in order to look at only a subset of the original collection.

Continue Reading »

Outlook icon

Save all attachments from selected folder, continued

In Save all attachments from selected folder, I posted a method for scrubbing an Outlook mail folder of file attachments in order to reduce your network footprint (or make your PST file smaller).

A couple of commenters asked if there's a way to make sure the filename is unique. There are two ways (I know of) to accomplish this goal, and we'll explore both in this post.

Continue Reading »

Random Data Generator