Enter your email address:

Delivered by FeedBurner

Home Page








Subscribe here
Add to My Yahoo!
This page is powered by Blogger. Isn't yours?

Host your Web site with PureHost!

eXTReMe Tracker

  Wednesday, March 03, 2010 – Permalink –

Mail Excel

VBA + sample

Excel Guru Ron de Bruin has put together the VBA code needed to send Excel via email.
He has also included the sample workbooks for those that are not VBA literate.

". . . a new add-in named RDBMail for Excel/Outlook 2007-2010

The add-in create a new tab on the Ribbon named RDBMail with a lot of mail options.
You have the option to send as workbook or PDF for every mail option."

Code to send mail from Excel

See all Topics

Labels: , , ,

<Doug Klippert@ 3:44 AM

Comments: Post a Comment

  Friday, February 05, 2010 – Permalink –

Order on the Right

Context Menu

Eric Legault shares the VBA code that can be used when "Organizing Your E-mail Using Custom Item Context Menus in Outlook 2007".

May appear to be daunting, but if you have had some exposure to VBA, it's not that bad.


See all Topics

Labels: , ,

<Doug Klippert@ 3:26 AM

Comments: Post a Comment

  Wednesday, June 17, 2009 – Permalink –

VBA Variable Problems

Explicit protection

It's good practice to always use the Option Explicit statement in the beginning of your code modules to ensure that all variables are unambiguously declared in your procedures.

With this process in place, you'll receive a "Variable not defined" error if you try to execute code containing undeclared variables. Without this statement, it's possible to mistype variable names, which would be interpreted as new Variant type variables.

This could severely impact the results of your code, and you might not ever know it. If you do find a problem, tracking down where the error is can be a chore.

Although you can manually type the statement into your modules, changing a setting in Access can ensure that the statement is always added to new modules.

  1. Open a module (start the VBA Editor)

  2. Choose Tools>Options from the menu bar

  3. On the Editor tab of the Options dialog box, select the Require Variable Declaration check box in the Code Settings panel

  4. Finally, click OK

See all Topics


<Doug Klippert@ 3:48 AM

Comments: Post a Comment

  Thursday, April 09, 2009 – Permalink –

Excel-lent E-Mail

Outlook, Excel, and VBA

Ron de Bruin, Microsoft MVP - Excel, has put together a collection of VBA routines to make Excel e-mail friendly.

See if these topics tempt you:

Example Code for sending mail from Excel
  • Mail Workbook
  • Mail one Sheet
  • Mail more than one Sheet
  • Mail the Selection or range
  • Mail Every Worksheet with Address in cell A1
  • Mail sheet or sheets to one or more people
  • Mail range or sheet in the body of the mail (Send personalized email)
  • Mail a message to each person in a range with Outlook
  • Mail a message to each person in a range with CDO (no security warnings)
  • Sending a different file to each person in a range with Outlook
  • Zip the ActiveWorkbook and mail it with Outlook
  • Security (Prevent displaying the dialog to Send or not Send)

Also Download Addins for Excel e-mail information

Also see:

John Walkenbach:
Sending Personalized Email from Excel

See all Topics

Labels: , , , ,

<Doug Klippert@ 3:28 AM

Comments: Post a Comment

  Thursday, June 19, 2008 – Permalink –

Global Area Code Changer

Fix Contacts

Telephone area codes sometimes run out of numbers and need to be split.'s Outlook Contacts Tools page offers some suggestions including:

Slovak Technical Services:
Phone Changer

After a reorganization or buyout, have you ever needed to replace domain portion of e-mail addresses in a Contacts folder?

Here's a macro from Woody Leonard's WOPR forum.

Global Change of email addresses

(If you use it, you might want to comment out some of the MSGBOX entries. )

See all Topics

Labels: , ,

<Doug Klippert@ 4:53 AM

Comments: Post a Comment

  Monday, May 26, 2008 – Permalink –

View Pictures

All at once

This article walks you through the process of using VBA to develop a form that will allow you to open all e-mail picture attachments at one time.

Office Developer Center:

Viewing Multiple Picture Attachments in Outlook 2003
By Eric Legault (Outlook MVP)

It helps to have some experience with VBA coding, but the instructions are clear and no other applications are needed other than the Visual Basic editor that is built into Outlook.

Eric Legault is also a blog contributor at Office
The source code for the MSDN article can be downloaded there. It includes the complete form as well as the code modules.

... "image viewers that use a Multiple Document Interface (MDI) are best suited as a custom viewer. It's better to have one application handle several open image windows than individual windows cluttering your Taskbar! A perfect application for this scenario is the Microsoft Office Photo Editor, but it is no longer bundled with Office 2003."

Microsoft has replaced Photo Editor with a new photo editing and cataloging program in Office 2003 and 2007: Microsoft Office Picture Manager.

Here is how to reinstall Photo Editor from your Office XP CD:
Photo Editor is removed when you install Office 2003 or Office 2007

See all Topics

Labels: , ,

<Doug Klippert@ 7:02 AM

Comments: Post a Comment

  Sunday, March 23, 2008 – Permalink –

Reminder - Task - E-mail

Sent from Access

A great web site for Office information is Woody Leonard's

There are a couple of newsletters associated with the site including:
Woody's ACCESS Watch

A recent issue has information about sending reminders to Outlook from Access.

"If you have a table that contains a date field, and you want to make sure that something happens on that date, one way is to create an Outlook task with a reminder that will pop up on the specified date; you can even use the Outlook reminder to create an email message that will be sent on the specified date.

This article will show how to create an Outlook task from Access VBA code, and send an email message when the task's reminder fires."

The file is located on Helen Feddema's site.
Access Archon
Scroll down to #126

The zip file contains the WAW article, in Word format, plus the supporting file.

Helen Feddema has been working with Word since v. 1.1, Access since the beta of v. 1.0, and Outlook since the beta of v. 8.0 (that's where Outlook started its version numbering).

See all Topics

Labels: , ,

<Doug Klippert@ 6:49 AM

Comments: Post a Comment

  Sunday, December 16, 2007 – Permalink –

Office VBA Tricks

Video + Free code

Quick tips VBA Video

"Learn tips and use sample code for several Office applications. These tips can help you to be more productive and can also be a starting point for developing your own tools, utilities and techniques."

  • Update Word Document Statistics in the Title Bar
  • Create Outlook Rules Programmatically
  • Delete Repeated Text Throughout a Word Document
  • Run Macros Based on the Value of One or More Excel Spreadsheet Cells
  • Disable Related Controls on a PowerPoint Slide After a User Clicks an Input Control
  • Display Reminder Information When a User Opens an Office Document
  • Synchronize an Access Main Form to a Subform and Vice Versa
  • Log Worksheet Changes to an XML File
  • Merge Body Text from Multiple Outlook E-mail Messages to a Word Document
  • Use the Office Assistant as an Alternative to Displaying and Retrieving User Input

Ten Tips for Office VBA Developers

See all Topics


<Doug Klippert@ 5:04 AM

Comments: Post a Comment

  Saturday, November 03, 2007 – Permalink –

Automation - VBA - Help File

Office Wide

"Automation (formerly known as OLE Automation) is a feature of the Component Object Model (COM), an industry-standard technology that applications use to expose their objects, methods, and properties to development tools, macro languages, and other applications.

For example, a spreadsheet application might expose a worksheet, chart, cell, or range of cells--each as a different type of object. A word processor might expose objects such as an application, document, paragraph, bookmark, or sentence.

When an application supports Automation, the objects that the application exposes can be accessed through Visual Basic. You can use Visual Basic to manipulate the objects by invoking methods or by getting and setting properties of the objects."

Here's an example:

Inserting Data into a Microsoft Word Document

With Automation code, you can open a Microsoft Word document and move to a bookmark location in the document. The following example opens a Microsoft Word document and inserts text after a bookmark.

This example assumes that you have Microsoft Word on your computer, that you have an existing document called C:\My Documents\WordTest.doc, and that the document contains a pre-defined bookmark named City.

Sub FindBMark()

Dim wordApp As Word.Application
Dim wordDoc As Word.Document
Dim wordRange As Word.Range

Set wordApp = CreateObject("Word.Application")
Set wordDoc = wordApp.Documents.Open("C:\My Documents\Wordtest.doc")

wordApp.Visible = True

' Go to the bookmark named "City".
Set wordRange = wordDoc.Goto(What:=wdGoToBookmark, Name:="City")
wordRange.InsertAfter "Los Angeles"

' Print the document.
wordDoc.PrintOut Background:=False

' Save the modified document.

' Quit Word without saving changes to the document.
wordApp.Quit SaveChanges:=wdDoNotSaveChanges

Set wordApp = Nothing

End Sub

Microsoft Support provides an entire Help file to assist you. It includes theory and examples.

The file is called XPAutomation.chm.

Download it and then double click on the file to run it. You could also set up a shortcut on the desk top, if it will be used frequently.

Microsoft Knowledge Base Article: 302460

This was aimed at Office 2002 but it can be used with later versions:

  • Microsoft Access
  • Microsoft Excel
  • Microsoft Outlook
  • Microsoft PowerPoint
  • Microsoft Word

See all Topics


<Doug Klippert@ 6:53 AM

Comments: Post a Comment

  Saturday, March 31, 2007 – Permalink –

Comment Code

Edit toolbar

You'll many times want to change blocks of code to comments in VBA modules; temporarily convert a block of VBA code to comments so that it's ignored during a trial run. Inserting an apostrophe before each line of code is a bother. Office 2000+ simplifies this task by letting you convert a block of code to comments with a click of a button.

Open any module in the Visual Basic Editor (VBE), and then choose View>Toolbars and choose Edit from the menu bar to display the Edit toolbar.

Select the lines of code that you want to turn into comments. Then, click the Comment Block button on the Edit toolbar (it's the