In Tip 824 Diane Poremsky shows us a bit of VBA that lets you add photos to your contacts in bulk. Let's try and improve the code.
add
Add and return Excel.Worksheet references in VBA
The Workbooks.Open Method creates a new workbook, adds it to the Workbooks Collection, and returns a Workbook Object which can be set to an object reference. i.e.
Sub TestWorkbookAdd() Dim wkbks As Excel.Workbooks Dim wkbk As Excel.Workbook Set wkbks = Excel.Workbooks Set wkbk = wkbks.Add End Sub
From Excel Help:
Creates a new workbook. The new workbook becomes the active workbook. Returns a Workbook object.
Look for and create folders programmatically in Outlook
If you are writing VBA code for Outlook, you might have a need to check for an existing folder, and create it if it doesn't exist.
Here are two functions that can assist. I wrote one that checks for an existing folder, and returns TRUE if it exists. It assumes a specific folder hierarchy, so you'll need to adjust it if the folders you are working with are on a different level. Works in Outlook but can be adapted for Excel use as well.


Follow Me