Ejemplo n.º 1
0
        public void PerformAction(string speechText)
        {
            speechText = Utility.TruncateActionString(speechText, "Read out");

            var item = Utility.GetNThItem(speechText);

            if (item is MailItem)
            {
                MailItem mailItem = (MailItem)item;
                Globals.ThisAddIn.Application.ActiveExplorer().ClearSelection();
                VoiceSearch.speakItOut(" The mail says: " + mailItem.Body).GetAwaiter().GetResult();
            }
            else
            {
                Console.WriteLine(item.GetType());
            }
        }
Ejemplo n.º 2
0
        public void PerformAction(string speechText)
        {
            speechText = Utility.TruncateActionString(speechText, "Reply");

            var item = Utility.GetNThItem(speechText);

            if (item is MailItem)
            {
                MailItem mailItem  = (MailItem)item;
                MailItem replyItem = mailItem.Reply();

                Globals.ThisAddIn.Application.ActiveExplorer().ClearSelection();
                replyItem.Display(false);

                VoiceSearch.speakItOut(" The Subject of the mail is : " + replyItem.Subject + ", You are Replying to " + replyItem.To).GetAwaiter().GetResult();
                //Task.Delay(1000).Wait();
                VoiceSearch.speakItOut("Tell me what you want to reply.").GetAwaiter().GetResult();
                //Task.Delay(2000).Wait();
                string body = VoiceSearch.RecognizeSpeechAsync().GetAwaiter().GetResult();
                replyItem.Body = body;

                VoiceSearch.speakItOut("Your Reply is ready. Do you want to Send or Discard?").GetAwaiter().GetResult();
                //Task.Delay(2000).Wait();

                string action = VoiceSearch.RecognizeSpeechAsync().GetAwaiter().GetResult();
                if (action.ToLower().Contains("send"))
                {
                    replyItem.Send();
                    VoiceSearch.speakItOut("Mail Sent.").GetAwaiter().GetResult();
                }
                else
                {
                    replyItem.Close(OlInspectorClose.olDiscard);
                    VoiceSearch.speakItOut("Mail Discarded.").GetAwaiter().GetResult();
                }
            }
            else
            {
                Console.WriteLine(item.GetType());
            }
        }
Ejemplo n.º 3
0
        public void PerformAction(string speechText)
        {
            speechText = Utility.TruncateActionString(speechText, "Flag");

            var item = Utility.GetNThItem(speechText);

            if (item is MailItem)
            {
                MailItem mailItem = (MailItem)item;
                Globals.ThisAddIn.Application.ActiveExplorer().ClearSelection();
                mailItem.FlagRequest = "Flag";
                mailItem.FlagStatus  = OlFlagStatus.olFlagMarked;
                mailItem.FlagDueBy   = DateTime.Today;
                mailItem.MarkAsTask(OlMarkInterval.olMarkToday);
                VoiceSearch.speakItOut(" Flagged the mail with subject: " + mailItem.Subject).GetAwaiter().GetResult();
            }
            else
            {
                Console.WriteLine(item.GetType());
            }
        }
 public void PerformAction(string text)
 {
     Globals.ThisAddIn.Application.ActiveExplorer().Search(text, Microsoft.Office.Interop.Outlook.OlSearchScope.olSearchScopeAllFolders);
     VoiceSearch.speakItOut("Searching for " + text).GetAwaiter().GetResult();
 }