A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

why does vb not recognise outlook code?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 21st 10, 01:58 PM posted to microsoft.public.outlook.program_vba
ninjaneer
external usenet poster
 
Posts: 1
Default why does vb not recognise outlook code?

Hi there

I'm still a complete amateur on outlook vba, so please bear with me.

I use Outlook 2003 (that I recieved with a student package of Office) on a
Windows 7 RC PC. I want to create a Macro that formats a mail as html. I
found some example code on the internet, but it gives errors claiming not to
recognize the objects:
"Method or data member not found" in response to
Application.ActiveInspector.CurrentItem.BodyForma t = olFormatPlain

or "User-defined type not found" in response to Dim olMail As
Outlook.MailItem

Any ideas on how I can reach my goal to create a Macro that formats a mail
as html or to address the errors?

Thank you for reading my post!

Pieka
Ads
  #2  
Old February 22nd 10, 09:44 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default why does vb not recognise outlook code?



That sounds like the code isn't running in Outlook but in another
application. There you need to add a reference on Outlook to make its object
model available: Click Tools/References, and add "Microsoft Outlook x
Library".

Also, 'Application' in VBA always refers to the Application of the host
application. For instance, if the code runs in Excel, Application refers to
the root object of Excel, not to the one of Outlook. That is you need to dim
a variable as Outlook.Application, and set it to the right object.

--
Best regards
Michael Bauer - MVP Outlook
Manage and share your categories:
http://www.vboffice.net/product.html?pub=6&lang=en


Am Sun, 21 Feb 2010 05:58:01 -0800 schrieb ninjaneer:

Hi there

I'm still a complete amateur on outlook vba, so please bear with me.

I use Outlook 2003 (that I recieved with a student package of Office) on a
Windows 7 RC PC. I want to create a Macro that formats a mail as html. I
found some example code on the internet, but it gives errors claiming not

to
recognize the objects:
"Method or data member not found" in response to
Application.ActiveInspector.CurrentItem.BodyForm at = olFormatPlain

or "User-defined type not found" in response to Dim olMail As
Outlook.MailItem

Any ideas on how I can reach my goal to create a Macro that formats a mail
as html or to address the errors?

Thank you for reading my post!

Pieka

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook doesn't recognise imported Contact's language zeus911 Outlook - Using Contacts 1 December 2nd 09 12:46 PM
Outlook2003 does not recognise his products Giamber Outlook - General Queries 4 May 17th 09 10:41 PM
How do I make Outlook recognise my country code? Mirror Fish Outlook - Using Contacts 2 November 20th 07 11:45 AM
E-Mail Doesn't recognise my distribution list. DarrenS Outlook - Using Contacts 9 April 30th 07 09:22 AM
how do I get active sync to recognise outlook wath angling center Outlook - Using Contacts 1 August 21st 06 04:44 PM


All times are GMT +1. The time now is 11:10 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.