Jump to content
Sign in to follow this  
motormad

search dir and email the pdf's in it

Recommended Posts

motormad

The job i like to automate.

Search a directori for files.

Set them in a array.

Mail them 1 fot 1

(maybe make them smaller size)

I would like to put the name (nummber's 5 digits) in a excel file.

Read them to a array

and search for them in a dir.

This i can do, no props.

I will post the code for this later on.

First i need to know if this jobis possible with autoit before i try.

1-can i read out a dir

2-put them in a array (if 1 goes then this would be a prop)

3-command outlook to mail them

Thanks in advance.

Share this post


Link to post
Share on other sites
motormad

Thanks Jhon LoL :-)

I will try and post my sollution .

Today i made it in à vba module .

Share this post


Link to post
Share on other sites
motormad

Almost there...

But have a problem with to attatch a file to the mail.

Im trying with this code.

The window of a naw email is open and i'm trying with jeystrokes to attach.

But it almost impossible. :-(

Func IMPORT_A_TO_AR($FILE)
;~ $Address = InputBox('Address', 'Enter the E-Mail address to send message to')
$Subject = "==> : " & $FILE ;InputBox('Subject', 'Enter a subject for the E-Mail')
$Body = "==> : " & $FILE ;InputBox('Body', 'Enter the body (message) of the E-Mail')
$ATT= $dir&$FILE
_INetMail($address, $subject, $body)
sleep(500)
Send("!i")
sleep(1000)
Send("b")
;Send("{ENTER}")
    sleep(1000)
Send($ATT)
    sleep(1000)
Send("!o")
;Send("{TAB}")
;    sleep(1000)
;Send("{TAB}")
;    sleep(1000)
;Send("{ENTER}")
;    sleep(1000)
;MsgBox(0,'E-Mail has been opened','The E-Mail has been opened and process identifier for the E-Mail client is ' & _INetMail($address, $subject, $body))
endfunc

Share this post


Link to post
Share on other sites
Mechaflash

Use _InetSmtpMail() if possible. This allows you to bypass the manual send, but you do have to have all of your email account's SMTP information available to make it work.

_InetSmtpMail() is in your help file as well.


Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Share this post


Link to post
Share on other sites
BrewManNH

You could also take a look at the Outlook.au3 UDF.

  • Like 1

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
motormad

I tried Outlook.au3 and OutlookEX.au3.

it only works with autoit 3.9.2

and not outlook 2003 (wich i use)

2012-07-01 - Version 0.8 - Downloads:

GENERAL

=======

* Needs AutoIt beta version 3.3.9.2 or later because of the new COM error handling.

Will still run with earlier versions but will crash if a COM error occurres and _OL_ErrorNotify has not been called before

* _OL_Open no longer initializes a COM error handler. Has to be done by _OL_ErrorNotify

Im using portable autoit..not 3.9.2

for _InetSmtpMail() its the echange server @ my work...

I dont know where to get the info needed :huh:

Edited by motormad

Share this post


Link to post
Share on other sites
Mechaflash

If you are not the administrator of the exchange server, I would recommend getting with an administrator FIRST before doing a project that involves its use. You may be breaking corporate IT rules that can lead to your termination.

If YOU are the administrator... drop what you're doing and go learn about how exchange server works.


Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Share this post


Link to post
Share on other sites
motormad

LoL no mate.

Im not THE administrator.

I just need to work somthing out to simplify some stuff.

I like to learn about scripting because it made my life easier

So if you can help me out :-)

Its because of firm policys that we can not sync 2 directorys. (firm-A to Firm-B )

If i can mail some files automaticly it would be good for both.

I dont see anny harm in that.

Edited by motormad

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
Sign in to follow this  

  • Similar Content

    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Friends,
      I am having a requirement where i have to automate outllook.I have to send mail using outlook.Whe i went through the forum i got OutLookEx.au3 but when i am trying to use this i am getting error can anyone help me in using this? @water
    • Gowrisankar
      By Gowrisankar
      Dear members of the forum,
      I'm working on a project where incoming emails are to be analyzed based on the subject line and moved to various folders in a shared mailbox.
      I'm using "OutlookEx.au3" of @water. The macro can can move emails  to any folder that I newly create. But the macro couldn't move emails to specific folders that are already existing.
      I checked the permission levels of those folders and found that nothing is wrong with that. The function I use is _OL_ItemMove.
      Please guide me how to proceed further. Thanks in advance.
      -Gowrisankar.
       
    • nooneclose
      By nooneclose
      Good morning everyone, I thought I had already solved this issue but it turns out I did not. 
      My code finds unread emails with this specific subject line of "request" but when I change the subject to SKIPPED + "request" = ("SKIPPED request") the program still finds the email and tries to process it. I only want to process emails with the exact match subject of "request".
      Here is my code that "finds" the unread emails with the subject of "request" or so I thought. 
      Func ListUnreadEmails() ;******************************************************************************* ; Lists all unread E-mails from the folder Outlook-UDF-Test ;******************************************************************************* ; Stores all the unRead emails into an array Global $aItems = _OL_ItemFind($oOutlook, "*\Outlook-UDF-Test", $olMail, _ "[UnRead]=True", "Subject", "request", "EntryID,Subject", "", 1) ; Displays the array of unRead emails If IsArray($aItems) Then ;_ArrayDisplay($aItems, "OutlookEX UDF: _OL_ItemFind - Unread mails") Else MsgBox(48, "OutlookEX UDF: _OL_ItemFind Example Script", _ "Could not find an unread mail. @error = " & @error & ", @extended: " & @extended) EndIf ; Gets the number of unread emails Global $numberOfUnRead = UBound($aItems, $UBOUND_ROWS) - 1 ;MsgBox("", "Number of Unread emails", $numberOfUnRead) EndFunc It acts as if any part of the subject containing the word "request" and the email is unread that it will try to process it. (I think)
    • nooneclose
      By nooneclose
      Good afternoon, I am in need of some help. I am sure this is a stupid question requiring only one or two lines of code. However, I would greatly appreciate the help I cannot figure this out. I also tried searching for the answer on the internet but no one except me apparently seems to be having a hard time figuring this out and or is asking about it. 
      I simply want to change the "status" of an email from unread to read once I have processed it. My code is over 500 lines and I would like not to clutter this post with it. Assume I have all my includes and connections properly defined and stuff. 
      Here is the bit of code where I am trying to change the email that was used from unread to read:
      Func ChangeEmailStatus() ;******************************************************************************* ; changes the status of an email from unread to Read ;******************************************************************************* Local $iRows = UBound($aItems, $UBOUND_ROWS) MsgBox("", "Number of Unread emails (Before Change)", $iRows) _OL_ItemModify($oOutlook,$aItems[$i][0], Default, "Read=True") MsgBox("", "Array Display 1", $aItems[1][0]) MsgBox("", "Array Display 2", $aItems[2][0]) Local $iRows = UBound($aItems, $UBOUND_ROWS) MsgBox("", "Number of Unread emails (After Change)", $iRows) EndFunc  
    • nooneclose
      By nooneclose
      Hello again everyone, I am trying to make a simple bot/AI to help me at work. I need it to read the subject line of emails, open them if a certain subject line is found, and then copy the contents of the said email and paste it in a different program. 
      Can the Autoit outlook UDF help me achieve this? 
      Also, I have tried the Outlook UDF and so far I have only figured out how to find all the unread emails (thanks to one of water's example scripts. @water you are a genius just saying).
      I am very new to this UDF and would love any help that would guide me into making this bot/AI a reality at work.   
×