12 posts in this topic
I wrote a macro for outlook to send an email.
Till yesterday it worked, don't know why it is not working today
I am getting below error when I ran the macro.
Through below script I am able to send mail with the Outlook installed in my machine.
But I am getting below prompt whenever I ran this script,by Outlook.
Can anyone suggest how to suppress this.
#include <MsgBoxConstants.au3> ; Counting the number of open shell windows Local $oShell = ObjCreate("Outlook.Application") ; Get the Windows Shell Object If IsObj($oShell) Then $Mail = $oShell.CreateItem(0) $Mail.To = "firstname.lastname@example.org" $Mail.Subject = "Action" $Mail.Body ="Pay rise please" $Mail.Send() EndIf
I am trying to read all the files in a folder, then whatever file is newest, keep only that one and delete the rest.
Example files: (these all have version numbers embedded in them, I dont want to rely on the file name)
What I have so far:
#include <File.au3> RemoveOldFiles() ConsoleWrite(FileGetVersion("C:\WB Resources\FAINT_DONT_LINK_THESE\Faint-v4.0.0.exe") &@CRLF) Func RemoveOldFiles() Local $aFileList = _FileListToArray("C:\WB Resources\FAINT_DONT_LINK_THESE\", "*.exe",$FLTA_FILES) For $i = 0 To UBound($aFileList) - 1 $aFileVersion = FileGetVersion($aFileList[$i]) ConsoleWrite($aFileList[$i] & @CRLF) ConsoleWrite($aFileVersion & @CRLF) Next EndFunc OUTPUT: >Running:(18.104.22.168):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\bot\ownCloud\WellBeats\Delete Old Files\delete-test.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop 3 0.0.0.0 a.exe 0.0.0.0 b.exe 0.0.0.0 Faint-v4.0.0.exe 0.0.0.0 22.214.171.124 <-- This is the correct file version.... +>07:34:26 AutoIt3.exe ended.rc:0 +>07:34:26 AutoIt3Wrapper Finished. >Exit code: 0 Time: 0.6647 Not sure what I am missing here?
Hi, I have written the following code and although the email is successfully created from a template it just sits in my draft folder without being sent and I can't figure out why?
#include <OutlookEX.au3> $Email = "email@example.com" $Outlook = _OL_Open() $olItem = _OL_ItemCreate($Outlook, 1, "", "Feedback.oft", "To=" & $Email) _OL_ItemSend($Outlook, $olItem, Default) _OL_Close($Outlook) Place Feedback.oft in the same folder as the script for it to run. Oh and you have to have a working Outlook installation and mail profile set up
SOLVED changed the 1 to $olMailItem
Purpose of script: To send emails in Outlook based on data in an excel spreadsheet. From: fields are entered for purposes of sending on behalf of (delegate), copies A2 cell from excel for To: field, Subject field is a static value and entered, returns to excel spreadsheet to read A1 and copy the first name and insert into the body of a template at an insertion point. The From, and the body of the email change based on region, so currently I have 6 different scripts that do essentially the same thing with some minor changes and want to consolidate into one script to save time.
To expedite the process of this and cut down on the amount of scripts, 6 in total I use daily, is it possible for me to somehow add the region to column C in excel, have autoit read column C values per row, and then decide which function, within a master script, to execute and loop this until there is no value in column C field?
Rob | firstname.lastname@example.org |Midwest
Annie | email@example.com | Midwest
Kyle | firstname.lastname@example.org | MidAtlantic
Rick | email@example.com | MidAtlantic
Blank | Blank | Blank |
Run Birthday.au3, execute loop part through hotkey
Reads row 1, C1, value is Midwest, calls Midwest(), script runs as Midwest Birthday.au3 does currently
Reads row 2, C2, value is Midwest, calls Midwest(), script runs as Midwest Birthday.au3 does currently
Reads row 3, C3, value is MidAtlantic, calls MidAtlantic(), script runs as MidAtlantic Birthday.au3 currently
Reads row 4, C4, value is MidAtlantic, calls MidAtlantic(), script runs as MidAtlantic Birthday.au3 currently
Reads row 5, C5, value is null or blank, ends script through Exit
Everything I have coded in my time in AutoIt has been based mostly on mouse based movements and I don't have variable programming knowledge so I feel like I'm close to understanding how to do this, but the reading/storing variables part is beyond my current skill set. Help is appreciated.
Mail Merges don't work as delegated in Outlook 07, for those that might be questioning why I just don't do that.