Results 1 to 20 of 20

Thread: [RESOLVED] Mail Retriever for Microsoft Outlook Exchange

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Location
    3rd rock from the sun
    Posts
    360

    Resolved [RESOLVED] Mail Retriever for Microsoft Outlook Exchange

    g'day

    got a little application that uses MAPI Control to:

    extract e-mails from local outlook account,
    -> checks Subject Field complies,
    -> ->creates a .txt file from e-mail's body for further reference.

    during runtime, Outlook MSG (attched jpg.. ) pops. and asks to user allow MailBox Access.

    AS Application is meant to run in background,
    Looking for a way to have no user interaction during runtime
    i.e.,
    ->access the above e-mail from the server. (?)
    ->create privileges programmatically. (?)
    -> ?????



    thanks in advance for any ideas, pointers, references.

    -j.
    Attached Images Attached Images  

  2. #2

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Location
    3rd rock from the sun
    Posts
    360

    Re: Mail Retriever for Microsoft Outlook Exchange

    Quote Originally Posted by RhinoBull
    VB6's MAPI controls were released back in 1998 so they might not be fully compatible with MS Office Outlook. I suggest you use Outlook's object model instead.
    ok cool Rhino,
    have managed (i think), with Outlook Object Model..
    so far, code accesses local inbox fine...

    trying to use the Outlook-Table Object, to filter down to only desired e-mails,(in this case UnRead/New e-mails).
    but falling over the filter parameter.. (codeLine=9):
    vb Code:
    1. Dim objOutlook As Interop.Outlook.Application
    2. 'Dim objMessage As Interop.Outlook.MailItem
    3. objOutlook = New Interop.Outlook.Application
    4. 'objMessage = objOutlook.CreateItem(Interop.Outlook.OlItemType.olMailItem)
    5. Dim oNS As Microsoft.Office.Interop.Outlook.NameSpace
    6. oNS = objOutlook.GetNamespace("mapi")
    7. Dim oFolder As Interop.Outlook.MAPIFolder
    8. oFolder = oNS.GetDefaultFolder(Interop.Outlook.OlDefaultFolders.olFolderInbox)
    9. Dim filter As String = "[subject] = String AND [new]=true"' FALLS HERE!!
    10. Dim oTable As Interop.Outlook.Table
    11. Try
    12.       oTable = oNS.GetDefaultFolder(Interop.Outlook.OlDefaultFolders.olFolderInbox).GetTable(filter, )
    13. Catch ex As Exception
    14.       MsgBox(ex.ToString)
    15. End Try

    filter parameter should be 'UnRead=True' or 'New=True'...
    getting a COM exception: not Valid argument

    any ideas on; How To get the new mails?
    any remarks regarding current code?
    any ideas on how i pull inbox directly from the MailServer?

    thanks again,
    -j

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Mail Retriever for Microsoft Outlook Exchange

    Moved to VB.NET

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Mail Retriever for Microsoft Outlook Exchange

    You can loop through the items in your Inbox checking the items .Unread property as being True.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Location
    3rd rock from the sun
    Posts
    360

    get e-mail body

    Quote Originally Posted by RobDog888
    You can loop through the items in your Inbox checking the items .Unread property as being True.
    tnx Rob, for suggesting.
    weird enough.. for "[Unread]=True" and for "[Read]=true" i get same number of e-mails. nevermind...
    (btw, no need for looping there, as outlook table obj is filtered by sql syntax.)

    new question please..

    post filtering, now that oTable has desired - unread/currDate/subject=constant.

    how to get the body of the actuall e-mail???

    thanks,
    -j.

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Mail Retriever for Microsoft Outlook Exchange

    oTable should have a Body field but if the email is an HTML one then it should be read from the .HTMLBody field.

    As you can see, by accessing the table this way it becomes complicated. If you iterate through the folders .Items collection you can access properties, filter, display a particular item etc.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Location
    3rd rock from the sun
    Posts
    360

    Re: Mail Retriever for Microsoft Outlook Exchange

    Quote Originally Posted by RobDog888
    oTable should have a Body field but if the email is an HTML one then it should be read from the .HTMLBody field.
    again, tnx for suggestin RobDog888
    cant find the Body field.. think oTable has rows, representing e-mail objects. need to somehow cast the row on a 'Dim oM As Interop.Outlook.MailItem '
    then oM has a oM.HTMLBody..
    do you know how to do that?

    Quote Originally Posted by RobDog888
    As you can see, by accessing the table this way it becomes complicated. If you iterate through the folders .Items collection you can access properties, filter, display a particular item etc.
    i can see!!! it IS complicated;
    would love to try a new way around this issue..
    any suggestions/example pls? (re. iterating through folder.Items that is..)

    thanks,
    -j.

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Mail Retriever for Microsoft Outlook Exchange

    You can do a loop like so...
    Code:
    Set oInbox = oApp.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
    For Each oEmail In oInbox.Items
        If oEmail.BodyFormat = Outlook.OlBodyFormat.olFormatHTML Then
            MessageBox.Show(oEmail.HTMLBody)
        Else
            Messagebox.Show(oEmail.Body)
        End If
    Next
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Location
    3rd rock from the sun
    Posts
    360

    Re: Mail Retriever for Microsoft Outlook Exchange

    Quote Originally Posted by RobDog888
    You can do a loop like so...
    many Thanks for suggesting Gansta.

    i go at it like so:
    vb Code:
    1. dim oM as Interop.Outlook.MailItem
    2.         For Each oM In oFolder.Items
    3.             If oM.Subject = "SCMB Securities Lending extract" And oM.UnRead = True Then
    4.                 MsgBox(oM.BodyFormat.ToString)
    5.             End If
    6.         Next

    gettin the following Error
    Code:
    Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Outlook.MailItem'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063034-0000-0000-C000-000000000046}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
    what am i doing wrong?

  11. #11
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Mail Retriever for Microsoft Outlook Exchange

    Do you have all email types in your inbox or do you have read receipts, appoint status', or non-standard emails?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Location
    3rd rock from the sun
    Posts
    360

    Re: Mail Retriever for Microsoft Outlook Exchange

    donno really.. i think all types huh..
    sorry to ask for help and i cannot offer more info here..

  13. #13
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Mail Retriever for Microsoft Outlook Exchange

    Are you using any Imports statements at the top of the class? If so which and post the code.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  14. #14

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Location
    3rd rock from the sun
    Posts
    360

    Re: Mail Retriever for Microsoft Outlook Exchange

    statements and code below.
    app falls on line 22.
    thanks.

    vb Code:
    1. Imports system
    2. Imports Microsoft.Office
    3. Imports System.IO
    4. Imports System.Windows.Forms
    5. Imports System.Xml
    6. Imports Microsoft.Office.Core
    7.  
    8.         Dim objOutlook As Interop.Outlook.Application
    9.         Dim oM As Interop.Outlook.MailItem
    10.         objOutlook = New Interop.Outlook.Application
    11.         Dim oNS As Microsoft.Office.Interop.Outlook.NameSpace
    12.         oNS = objOutlook.GetNamespace("mapi")
    13.         Dim oFolder As Interop.Outlook.MAPIFolder
    14.         oFolder = oNS.GetDefaultFolder(Interop.Outlook.OlDefaultFolders.olFolderInbox)
    15.         Dim filter As String = "[subject]=SCMB Securities Lending extract AND [unread]=true "
    16.         Dim oTable As Interop.Outlook.Table
    17.         Try
    18.             oTable = oNS.GetDefaultFolder(Interop.Outlook.OlDefaultFolders.olFolderInbox).GetTable(filter)
    19.         Catch ex As Exception
    20.             MsgBox(ex.Message)
    21.         End Try
    22.         For Each oM In oFolder.Items
    23.             If oM.Subject = "SCMB Securities Lending extract" And oM.UnRead = True Then
    24.                 MsgBox(oM.BodyFormat.ToString)
    25.             End If
    26.         Next
    27.  
    28.         Do Until oTable.EndOfTable
    29.             oM = oTable.FindNextRow
    30.             MsgBox(oM.HTMLBody)
    31.         Loop

  15. #15
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Mail Retriever for Microsoft Outlook Exchange

    You dont need two imports statements for Office. Could be confusing VS and having it relate objects to the wrong types.

    Code:
    Imports System
    Imports System.IO
    Imports System.Windows.Forms
    Imports System.Xml
    Imports Outlook = Microsoft.Office.Interop.Outlook
    [color=and then fix up your code so its properly referencing the interop classes of Outlook objects.[/color]
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  16. #16

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Location
    3rd rock from the sun
    Posts
    360

    Re: Mail Retriever for Microsoft Outlook Exchange

    Quote Originally Posted by RobDog888
    You dont need two imports statements for Office. Could be confusing VS and having it relate objects to the wrong types.

    and then fix up your code so its properly referencing the interop classes of Outlook objects.
    ok. thanks for pointing this out..

    yr suggestion implemented below (fine?)

    vb Code:
    1. Imports system
    2. Imports System.IO
    3. Imports System.Windows.Forms
    4. Imports System.Xml
    5. Imports outlook = Microsoft.Office.Interop.Outlook
    6.  
    7.  
    8. Public Class frmMain
    9.  
    10.     Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    11.  
    12.         Dim objOutlook As Microsoft.Office.Interop.Outlook.Application
    13.         Dim oM As Microsoft.Office.Interop.Outlook.MailItem
    14.         objOutlook = New Microsoft.Office.Interop.Outlook.Application
    15.         Dim oNS As Microsoft.Office.Interop.Outlook.NameSpace
    16.         oNS = objOutlook.GetNamespace("mapi")
    17.         Dim oFolder As Microsoft.Office.Interop.Outlook.MAPIFolder
    18.         oFolder = oNS.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox)
    19.         For Each oM In oFolder.Items
    20.             If oM.Subject = "SCMB Securities Lending extract" And oM.UnRead = True Then
    21.                 MsgBox(oM.BodyFormat.ToString)
    22.             End If
    23.         Next
    24.         Dim filter As String = "[subject]=SCMB Securities Lending extract AND [unread]=true "
    25.         Dim oTable As Microsoft.Office.Interop.Outlook.Table
    26.         Try
    27.             oTable = oNS.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox).GetTable(filter)
    28.         Catch ex As Exception
    29.             MsgBox(ex.Message)
    30.         End Try
    31.         MsgBox(oTable.GetRowCount)
    32.         Do Until oTable.EndOfTable
    33.             oTable.FindNextRow.Item(2).ToString()
    34.             oM = oTable.FindNextRow
    35.             MsgBox(oM.HTMLBody)
    36.         Loop
    37.         objOutlook.Quit()
    38.         objOutlook = Nothing
    39.         GC.Collect()
    40.     End Sub
    41.  
    42. End Class

    unfortunately, error persists

    error Code:
    1. System.InvalidCastException was unhandled
    2.   Message="Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Outlook.MailItem'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063034-0000-0000-C000-000000000046}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))."
    3.   Source="myMailRetriever"
    4.   StackTrace:
    5.        at myMailRetriever.frmMain.frmMain_Load(Object sender, EventArgs e) in C:\Documents and Settings\jsavir\Desktop\Checked Out\myMailRetriever\myMailRetriever\myMailRetriever\frmMain.vb:line 29
    6.        at System.EventHandler.Invoke(Object sender, EventArgs e)
    7.        at System.Windows.Forms.Form.OnLoad(EventArgs e)
    8.        at System.Windows.Forms.Form.OnCreateControl()
    9.        at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
    10.        at System.Windows.Forms.Control.CreateControl()
    11.        at System.Windows.Forms.Control.WmShowWindow(Message& m)
    12.        at System.Windows.Forms.Control.WndProc(Message& m)
    13.        at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
    14.        at System.Windows.Forms.ContainerControl.WndProc(Message& m)
    15.        at System.Windows.Forms.Form.WmShowWindow(Message& m)
    16.        at System.Windows.Forms.Form.WndProc(Message& m)
    17.        at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    18.        at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    19.        at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    20.        at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
    21.        at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
    22.        at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
    23.        at System.Windows.Forms.Control.set_Visible(Boolean value)
    24.        at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    25.        at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    26.        at System.Windows.Forms.Application.Run(ApplicationContext context)
    27.        at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
    28.        at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
    29.        at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
    30.        at myMailRetriever.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
    31.        at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
    32.        at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
    33.        at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
    34.        at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    35.        at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    36.        at System.Threading.ThreadHelper.ThreadStart()

  17. #17

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Location
    3rd rock from the sun
    Posts
    360

    found it!!! SORTED- Thanks very much

    found a way.

    thanks RobDog for your help

  18. #18
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: [RESOLVED] Mail Retriever for Microsoft Outlook Exchange

    Glad its working now for you.

    Just wanted to note that if you use the Imports for a class then you dont need to keep fully qualifying it in the definition of the variables etc.

    Dim objOutlook As Microsoft.Office.Interop.Outlook.Application

    Could simply be ...
    Dim objOutlook As Outlook.Application
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  19. #19

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Location
    3rd rock from the sun
    Posts
    360

    Re: [RESOLVED] Mail Retriever for Microsoft Outlook Exchange

    Quote Originally Posted by RobDog888
    Glad its working now for you.

    Just wanted to note that if you use the Imports for a class then you dont need to keep fully qualifying it in the definition of the variables etc.

    Dim objOutlook As Microsoft.Office.Interop.Outlook.Application

    Could simply be ...
    Dim objOutlook As Outlook.Application
    i see, i'm learnin. here . mm, so thought that is what you meant in this post:
    Quote Originally Posted by RobDog888
    You dont need two imports statements for Office. Could be confusing VS and having it relate objects to the wrong types.

    and then fix up your code so its properly referencing the interop classes of Outlook objects.
    sorry, what do you mean by "so its properly referencing the interop classes of Outlook objects" ??
    are objects properly referenced now?


    p.s
    many thanks for sharing your knowledge. i appreciate your help.

  20. #20
    New Member
    Join Date
    Jan 2009
    Posts
    1

    Re: [RESOLVED] Mail Retriever for Microsoft Outlook Exchange

    Hi I am using C#.net and facing the same problem.
    How to solve it ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width