Jump to content
nooneclose

[SOLVED] Having issues moving an email to a folder under another accounts inbox

Recommended Posts

Morning, I am having trouble moving emails to a folder under another account's inbox. 

Here is the code I have tried so far. 

 

; Access the Need Human folder under HELPDESK email account
    Local $nhFolder = _OL_FolderAccess($oOutlook, "helpdesk@hotmail.com\Inbox\Need Human")
    If @error <> 0 Then Exit MsgBox(16, "GC_WO_BOT:", "Error accessing folder 'helpdesk@hotmail.com\Inbox\Need Human'. @error = " & @error & " at line: " & @ScriptLineNumber)

    ;_ArrayDisplay($nhFolder, "Folder Access")
    ;MsgBox("", "email", $aItems[1][0])

    
    ; Move the E-mails
    _OL_ItemMove($oOutlook, $aItems[1][0], Default, $nhFolder[5], "Need Human")
    If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemMove", "Error moving specified Email. @error = " & @error & ", @extended = " & @extended & " at line: " & @ScriptLineNumber)
    ConsoleWrite("The current email " & $aItems[1][0] & "was just moved to: " & $nhFolder[1] & @CRLF)

I get error moving specified email @error = 1, @extended = 1 

Edited by nooneclose

Share this post


Link to post
Share on other sites

I figured it out, Here is the final working code.

Func MoveSkippedMail()

    ConsoleWrite("Sub-Action 4: Move the Skipped E-mails" & " at line: " & @ScriptLineNumber & @CRLF)
    ConsoleWrite("The current email's subject was just changed. 'Processed' has been added." & "at line: " & @ScriptLineNumber & @CRLF)

    ; Access the Need Human folder under HELPDESK email account
    Local $nhFolder = _OL_FolderAccess($oOutlook, "helpdesk@hotmail.com\Inbox\Need Human")
    If @error <> 0 Then Exit MsgBox(16, "GC_WO_BOT:", "Error accessing folder 'helpdesk@hotmail.com\Inbox\'. @error = " & @error & " at line: " & @ScriptLineNumber)

    ;_ArrayDisplay($nhFolder, "Folder Access")
    ;MsgBox("", "email", $aItems[1][0])

    ; Move the E-mails
    _OL_ItemMove($oOutlook, $aItems[1][0], Default, $nhFolder[1])
    If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemMove", "Error moving specified Email. @error = " & @error & ", @extended = " & @extended & " at line: " & @ScriptLineNumber)
    ConsoleWrite("The current email " & $aItems[1][0] & "was just moved to: " & $nhFolder[1] & @CRLF)

    ConsoleWrite("Action 15: Finished" & " at line: " & @ScriptLineNumber & @CRLF)
EndFunc

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By nooneclose
      Why can I not click on either of my input fields?
      #Region ### START Koda GUI section ### Form= Global $Form1 = GUICreate("Form1", 730, 437, 192, 124) ;GUISetFont(14, 800, 0, "MS Sans Serif") GUISetBkColor(0xC0DCC0) Global $Label1 = GUICtrlCreateLabel("Enter your Password. UserName is auto filled", 62, 40, 604, 41, $SS_CENTER) GUICtrlSetFont(-1, 26, 800, 0, "MS Sans Serif") Global $Label2 = GUICtrlCreateLabel("User Name:", 120, 130, 604, 31, $SS_LEFT) GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif") Global $Label3 = GUICtrlCreateLabel("Password:", 135, 210, 604, 31, $SS_LEFT) GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif") Global $Input1 = GUICtrlCreateInput(@UserName, 274, 130, 185, 32) GUICtrlSetFont(-1, 14, 800, 1, "MS Sans Serif") Global $Input2 = GUICtrlCreateInput("Password", 274, 210, 185, 32, $ES_PASSWORD) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") Global $OK = GUICtrlCreateButton("OK", 274, 270, 185, 57) GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $OK Global $UserName = GUICtrlRead($Input1) Global $PassWord = GUICtrlRead($Input2) ExitLoop EndSwitch WEnd ; Delete the GUI window GUIDelete()  
    • By cruisepandey
      Hi, 
      I have a string like this : 
      Global $Msga = "urrent directory is /send.  (Submission of file with log number 29381077284 is confirmed)";
      I want to extract the number 29381077284  from the string. I did StringSplit to split based on "(" and then use space to reach there, But it's not a good choice. 
      Can anyone help me with regular expression to find the number from String using AutoIT. TIA
    • By nooneclose
      I want wanting to run multiple tests on my company website. Sadly the process I want to automate requires opening a File Explorer to add an attachment. Is there a way in to automate a Chrome opened File Explorer?
      (I am using webdriver to automate the other 99% of the process just fine. But when I have it click on attach file and chrome opens a file explorer I do not know how to handle it.) 
      Any help would be greatly appreciated. 
    • By cruisepandey
      Hi There ! 
      I have a script here : 
       
      ;Launch CMD
      Run("C:\Windows\System32\cmd.exe")
      sleep(2000)
      $cmdHandle = WinActivate("C:\Windows\System32\cmd.exe")
      Sleep(2000)
      ;Sending document
      ControlSend($cmdHandle, "", "", "ftp" & @CRLF)
      ControlSend($cmdHandle, "", "", "open" & @CRLF)
      Sleep(2000)
      ControlSend($cmdHandle, "", "", "first command" & @CRLF)
      Sleep(2000)
      ControlSend($cmdHandle, "", "", "second-coomand" & @CRLF)
       
      first-command and second-command I can't provide cause it's internal. I have complied this .au3 file into an exe and it does the work. But I need to invoke this with Java. Java code I have tried is : 
       
          ProcessBuilder pb = new ProcessBuilder("C:\\Users\\username\\eclipse-workspace\\Examples\\src\\com\\own\\examples\\etc.exe");
          pb.start();
          Thread.sleep(5000);
       
      Through java it just launches the cmd and nothing happens after that. Please help !!
    • By FUD
      hello 
      please i need help 
      i need to open link in default browser only one windows without duplicate if i try to open the same link 
       
      thanks 
×
×
  • Create New...