Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to read the mail from OutLook Express using UIAutomation in C# 3.0

How to read the mail from OutLook Express using UIAutomation in C# 3.0

Scheduled Pinned Locked Moved C#
csharptestingtoolsregexhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bruze
    wrote on last edited by
    #1

    Can any one Help, I am trying to do following step dynamically using UIAutomation in c# 3.0 1)Open Outlook 2)Open Inbox 3)Select first unread email. 4)Open the first unread email. 5)If there are attachements, download the attachements. Select next unread email and do the same as above. I have tried below code.I Can open the outlook Express.But I can't read mail.

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Threading;
    using System.Windows.Automation;
    using System.Diagnostics;

    namespace ConsoleApplicationUI
    {
    public class ReadMail
    {
    static void Main(string[] args)
    {
    ProcessStartInfo psInfo = new ProcessStartInfo(@"C:\Program Files\Outlook Express\msimn.exe");
    Process prov = Process.Start(psInfo);
    Thread.Sleep(5000);

            //Read Inbox
            AutomationElement Inboxstart = null;
            PropertyCondition Inboxconds = new PropertyCondition(AutomationElement.NameProperty, "Inbox");
            Inboxstart = AutomationElement.RootElement.FindFirst(TreeScope.Descendants, Inboxconds);
    
    
            if (Inboxstart != null)
            {
                InvokePattern InboxstartInvoke = (InvokePattern)Inboxstart.GetCurrentPattern(InvokePattern.Pattern);
                InboxstartInvoke.Invoke();
            }
    
           
            Console.Read();
        }
    }
    

    }

    Thanks, Bruze

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups