View Single Post
  #3  
Old August 15th 07, 09:10 PM posted to microsoft.public.outlook.program_vba
John Z
external usenet poster
 
Posts: 2
Default Please help on this VBA macro. Error 13, type mismatch

Thank you for your quick response.

Actually "Microsoft Word 12.0 Object library" was checked even before I test
the Macros. I try to compile it as you suggested, but the Compile project1 is
grey out and not clickable. Any idea? Thank you.

"Eric Legault [MVP - Outlook]" wrote:

I'm guessing some Office references didn't stick during the upgrade. Open
Outlook's VBA Editor, and choose References from the Tools menu. If you
don't see "Microsoft Word 12.0 Object library" listed near the top (and
checked), browse the list until you find it and check the box. Click OK,
then choose "Compile VbaProject" from the Debug menu (or a similarly named
project - it will be the first menu item). If there are no more missing
references (and no errors in the code), everything is fine. Otherwise a
dialog will tell you the issue. Fix it if you can and repeat until the
project compiles successfully. You'll have to do this on each PC that may
have the same macros deployed in Outlook.

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"John Z" wrote:

HI, Everyone,

I am very new to VBA. Recently I upgraded Office 2003 to Office 2007 for the
staffs in our company. But some of the macros can not work since then. A
person who helf our company long time ago prepared these vba codes. That's
purpose for this macro is to let our admin staff to create evelope and label
efficiently. In Outlook 2003, select one contact from Public folders, then
one of these macro to create a lable/evenlope automatically. It worked fine
in Outlook 2003 but always gives me this "type mismatch" error. I run the
debug. It seems it always have problem when the program reaches
Set AddressTable = currentDoc.Tables(1)
Set rgeAddress = AddressTable.Cell(1, 1).Range

After the program execute "Set AddressTable = CurrentDoc.Tables(1)", it goes
to error message. rgeAddress and AddressTable are define as in the beginning
of the sub. "Dim rgeAddress As Range" and "Dim AddressTable As Table".

Please help. Thank you very much in advance.




Ads