Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 25th, 2005, 05:36 PM
Authorized User
Join Date: Jun 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default "Option Strict On" with Microsoft Outlook Object


When I set "Option Strict" to On, I'm getting an error message "Option Strict On disallows implicit conversions from 'System.Object' to 'Outlook.MailItem' with the following code:

Dim oApp As New Outlook.Application
Dim oNS As Outlook.NameSpace = oApp.GetNamespace("MAPI")
Dim oInBox As Outlook.MAPIFolder = _
   oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFo lderInbox)
Dim oItems As Outlook.Items = oInBox.Items
Dim oMsg As Outlook.MailItem

The error occurs on the last line (Dim oMsg as Outlook.MailItem).

Since nothing is defined as an Object, I don't know what to do to get rid of the error message. I have a reference set to Microsoft Outlook 11.0 Object Library.

Any suggestions will be greatly appreciated.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Option Strict On/passing a Datarow cesarfranciso Pro Visual Basic 2005 0 August 1st, 2007 06:04 PM
Option Strict on / Late Binding (p.535) irish_songbird BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 0 October 18th, 2006 12:51 PM
Option Strict Conversion Problem Little Shell VB.NET 2002/2003 Basics 1 July 17th, 2006 01:30 PM
Microsoft Outlook 11.0 Object Library ritag General .NET 0 January 21st, 2005 02:21 PM
Option Strict kevin777 VB.NET 2002/2003 Basics 2 October 10th, 2003 11:38 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.