mustilem23

Outlook message autoit pdf copy paste

48 posts in this topic

Hey fellas ,

 

With Autoit, we want to add pdf to pc in Outlook message and add text to the text part of the program named IFS. Can you help about AU3 codes for this?

 

 

 

I can switch to shit codes with IFS, but I can not help with Outlook messaging.

Opt('TrayIconDebug', 1)
   Opt("WinTitleMatchMode", 2)
  _WinWaitActivate("Satis Teklifi -","")
   Local $sText = WinGetTitle("[ACTIVE]")
   $sText=StringMid($sText,17,9)

 

 

 

Share this post


Link to post
Share on other sites



Welcome to Autoit and the forum!

I suggest to have a look at my OutlookEX UDF (link can be found in my signature).


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thank you ,:drool:

 

 

I've searched and downloaded it before I opened it, but I have not succeeded with some au3. But it is not what I want ,,, I would like to ask the subject special au3. Can it be encoded? Sample ; If Autoit first opens the screen (sale offer) screen named I.fs, mause click right 4 tab enter then enter on the screen and save the pdf to the following path C: \ Users \ willafa \ Desktop offer.pdf then this pdf outlook is also open as forward Email e and again i.fs sales offer screen tab 4 copy outlook paste and output to the subject line, Overall this is a short case and the autoit is too weak please help.

Edited by mustilem23

Share this post


Link to post
Share on other sites
12 minutes ago, mustilem23 said:

Overall this is a short case and the autoit is too weak please help.

You aren't making too much sense here. What exactly are you asking us?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

 

I'm running Autoit as the scenario is first opened as an email forwarding from Outlook, then I'm going to go to the program called IFS

Come outlook message page


First of all, can you help me with the syntax needed in the script?

Then i will send and set my tab

Edited by mustilem23

Share this post


Link to post
Share on other sites

 

Hello ,

Auxiliary file for narration.

Shuan home I.F.S here no scenario example.

help please , For start and end codes please.

 

http://hizliresim.com/2ndoYL

 

 

 

Share this post


Link to post
Share on other sites

I understand that you are no native speaker. Currently your posts are hard to understand.
Could you please write in your native language and use Google translate to translate the text to English before posting?

I'm sure we then will be able to help you :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)


Evet, ana dilimi, verileri bir klasörden almak ve dosyayı bir e-postaya türk amaçlı eklemek için bir program kullanmaktır :drool:

 

Senaryo aşağıdaki gibidir: Birincisi, gelen posta mesaj olarak çağrıldığında açık kalır, daha sonra Ifs adlı program açılır ve bu nedenle 2 aktif ekran ve otomatik çalıştırma başlar

 

Autoit İlk iş IFS tab4 adlı programa gider. Bir kopyasını yapar, daha sonra postpipe'ın bir parçası olarak açık olan postaya outlok gönderir, daha sonra dosyayı klasörden alır pdf e-posta yapıştır ve sonlandır

 

Sizin için basit ama benim için kodlar kodlarla başlıyor ve geçişleri çok zorlaştırmamda bana yardımcı olun

 

 

Edited by mustilem23

Share this post


Link to post
Share on other sites

 

Dear water ,

Can code be written for those with autoit gif ?

OVbm24.gif

 

 

 

Share this post


Link to post
Share on other sites

#10 ·  Posted

Please have a look at my OutlookEX UDF.

Function _OL_ItemCreate creates the new mail and lets you set the subject, recipient etc.
Function _OL_ItemAttachmentAdd lets you add an attachment.

Please check the example files _OL_ItemCreate.au3 and _OL_ItemAttachmentAdd.au3.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#11 ·  Posted

Dear water ,

OutlookEX UDF retest I got the  following error.

 

2 inches

example files _OL_ItemCreate.au3 and _OL_ItemAttachmentAdd.au3.

http://hizliresim.com/77nm2l

 

Can we arrange for email messages with codes open
#include <OutlookEX.au3>

; *****************************************************************************
; Create test environment
; *****************************************************************************
Global $oOutlook = _OL_Open()
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended)
Global $Result = _OL_TestEnvironmentCreate($oOutlook)
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF - Manage Test Environment", "Error creating the test environment. @error = " & @error & ", @extended = " & @extended)

; *****************************************************************************
; Example 1
; Attach a file to a mail (link to the file)
; *****************************************************************************
Global $aOL_Item = _OL_ItemFind($oOutlook, "*\Outlook-UDF-Test\SourceFolder\Mail", $olMail, "", "", "", "EntryID")
If $aOL_Item[0][0] = 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemAttachmentAdd Example Script", "Could not find a mail item in folder 'Outlook-UDF-Test\SourceFolder\Mail'. @error = " & @error)
Global $oItem = _OL_ItemAttachmentAdd($oOutlook, $aOL_Item[1][0], Default, @ScriptDir & "\The_Outlook.jpg," & $olByReference)
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemAttachmentAdd Example Script", "Error adding attachment to mail item in folder 'Outlook-UDF-Test\SourceFolder\Mail'. @error = " & @error & ", @extended = " & @extended)
; Display item
$oItem.Display
MsgBox(64, "OutlookEX UDF: _OL_ItemAttachmentAdd Example Script", "A link to the file was successfully added to the mail item!")

; *****************************************************************************
; Example 2
; Attach a file to a task (copy file)
; *****************************************************************************
$aOL_Item = _OL_ItemFind($oOutlook, "*\Outlook-UDF-Test\SourceFolder\Tasks", $olTask, "", "", "", "EntryID")
If $aOL_Item[0][0] = 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemAttachmentAdd Example Script", "Could not find a task item in folder 'Outlook-UDF-Test\SourceFolder\Tasks'. @error = " & @error)
$oItem = _OL_ItemAttachmentAdd($oOutlook, $aOL_Item[1][0], Default, @ScriptDir & "\The_Outlook.jpg")
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemAttachmentAdd Example Script", "Error adding attachment to task item in folder 'Outlook-UDF-Test\SourceFolder\Tasks'. @error = " & @error & ", @extended = " & @extended)
; Display item
$oItem.Display
MsgBox(64, "OutlookEX UDF: _OL_ItemAttachmentAdd Example Script", "A copy of the file was successfully added to the task item!")

_OL_Close($oOutlook)

 

I need a lot of such an application

 

 

 

 

Share this post


Link to post
Share on other sites

#12 ·  Posted

2 minutes ago, mustilem23 said:

Dear water ,


OutlookEX UDF retest I got the  following error.

 


2 inches

example files _OL_ItemCreate.au3 and _OL_ItemAttachmentAdd.au3.

http://hizliresim.com/77nm2l

 

Can we edit the codes for the open message :drool:

#include <OutlookEX.au3>

; *****************************************************************************
; Create test environment
; *****************************************************************************
Global $oOutlook = _OL_Open()
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended)
Global $Result = _OL_TestEnvironmentCreate($oOutlook)
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF - Manage Test Environment", "Error creating the test environment. @error = " & @error & ", @extended = " & @extended)

; *****************************************************************************
; Example 1
; Attach a file to a mail (link to the file)
; *****************************************************************************
Global $aOL_Item = _OL_ItemFind($oOutlook, "*\Outlook-UDF-Test\SourceFolder\Mail", $olMail, "", "", "", "EntryID")
If $aOL_Item[0][0] = 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemAttachmentAdd Example Script", "Could not find a mail item in folder 'Outlook-UDF-Test\SourceFolder\Mail'. @error = " & @error)
Global $oItem = _OL_ItemAttachmentAdd($oOutlook, $aOL_Item[1][0], Default, @ScriptDir & "\The_Outlook.jpg," & $olByReference)
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemAttachmentAdd Example Script", "Error adding attachment to mail item in folder 'Outlook-UDF-Test\SourceFolder\Mail'. @error = " & @error & ", @extended = " & @extended)
; Display item
$oItem.Display
MsgBox(64, "OutlookEX UDF: _OL_ItemAttachmentAdd Example Script", "A link to the file was successfully added to the mail item!")

; *****************************************************************************
; Example 2
; Attach a file to a task (copy file)
; *****************************************************************************
$aOL_Item = _OL_ItemFind($oOutlook, "*\Outlook-UDF-Test\SourceFolder\Tasks", $olTask, "", "", "", "EntryID")
If $aOL_Item[0][0] = 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemAttachmentAdd Example Script", "Could not find a task item in folder 'Outlook-UDF-Test\SourceFolder\Tasks'. @error = " & @error)
$oItem = _OL_ItemAttachmentAdd($oOutlook, $aOL_Item[1][0], Default, @ScriptDir & "\The_Outlook.jpg")
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemAttachmentAdd Example Script", "Error adding attachment to task item in folder 'Outlook-UDF-Test\SourceFolder\Tasks'. @error = " & @error & ", @extended = " & @extended)
; Display item
$oItem.Display
MsgBox(64, "OutlookEX UDF: _OL_ItemAttachmentAdd Example Script", "A copy of the file was successfully added to the task item!")

_OL_Close($oOutlook)

 

I need a lot of such an application

 

 

 

 

 

Share this post


Link to post
Share on other sites

#13 ·  Posted

Which version of Outlook do you run?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

dear water ,

microsoft outlook 2010,

http://hizliresim.com/Qv31pA

 

I made the setup of OutlookEX UDF wrong?
General au3. Can it be done with codes

Does the setup for OutlookEX UDF have video narration?

 

 

 

Edited by mustilem23

Share this post


Link to post
Share on other sites

#15 ·  Posted

Let's make it as easy as possible. This is an example script that creates a new mail, sets the subject and adds a PDF.

#include <OutlookEX.au3>

; Open connection to Outlook
Global $oOutlook = _OL_Open()
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended)

; Create a new mail item and set th subject
$oItem = _OL_ItemCreate($oOutlook, $olMailItem, "*", "", "Subject=<xx>") ; Change <xxx> to your subject
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a new mail. @error = " & @error & ", @extended = " & @extended)

; Add a PDF file
Global $oItem = _OL_ItemAttachmentAdd($oOutlook, $oItem, Default, @ScriptDir & "\<Test.pdf>") ; Change <Test.pdf> to the nam of your PDF file - or change the whole path if the fil is stored in a different directory.
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error adding attachment to mail item. @error = " & @error & ", @extended = " & @extended)

; Display item
$oItem.Display

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#16 ·  Posted

dear water ,

An empty au3. The files I've added to the file are nothing,

I think i set up wrong outlook udf yi.

 Installation videosu yada outlok udf you au3. Can it be done with codes? I would very much like to.

 

My goal is not to send e-mail,

Add data and pdf to open e-mail

 

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

#include <OutlookEX.au3>

Global $oOutlook, $oInspector, $oItem
; Open connection to Outlook
$oOutlook = _OL_Open()
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended)

; Access the currently displayed mail item
$oInspector = $oOutlook.ActiveInspector
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error accessing ActiveInspector. @error = " & @error & ", @extended = " & @extended)
$oItem = $oInspector.CurrentItem
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error accessing current item. @error = " & @error & ", @extended = " & @extended)
If $oItem.Class <> $olMail Then Exit MsgBox(16, "OutlookEX UDF", "Current item isn't a mail item. @error = " & @error & ", @extended = " & @extended)

; Add a PDF file
$oItem = _OL_ItemAttachmentAdd($oOutlook, $oItem, Default, @ScriptDir & "\<Test.pdf>") ; Change <Test.pdf> to the nam of your PDF file - or change the whole path if the fil is stored in a different directory.
If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error adding attachment to mail item. @error = " & @error & ", @extended = " & @extended)

; Display item
$oItem.Display

This works with the active mail item.
To set properties of the mail item please use function _OL_ItemModify.

Edited by water
Fixed syntax errors

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#18 ·  Posted

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\mdogru\Desktop\evden gelen\OutlookEX 1.2.2.0\_OL_ItemModify.au3" /UserParams    
+>15:00:25 Starting AutoIt3Wrapper v.15.920.938.0 SciTE v.3.6.0.0   Keyboard:0000041F  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:041F)
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\mdogru\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\mdogru\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\mdogru\Desktop\evden gelen\OutlookEX 1.2.2.0\_OL_ItemModify.au3
"C:\Users\mdogru\Desktop\evden gelen\OutlookEX 1.2.2.0\_OL_ItemModify.au3"(8,42) : warning: $oOL: possibly used before declaration.
Global $oInspector = $oOL.ActiveInspector
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\mdogru\Desktop\evden gelen\OutlookEX 1.2.2.0\_OL_ItemModify.au3"(8,42) : error: $oOL: undeclared global variable.
Global $oInspector = $oOL.ActiveInspector
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\mdogru\Desktop\evden gelen\OutlookEX 1.2.2.0\_OL_ItemModify.au3 - 1 error(s), 1 warning(s)
!>15:00:25 AU3Check ended. Press F4 to jump to next error.rc:2
+>15:00:25 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 1.144

 

 

 We activated _OL_ItemModify file with Edit Script but got an error at the following row

Global $oInspector = $oOL.ActiveInspector

Once more, I need to add a pdf file to an open e-mai + to copy data from a program to the Subject line.

Please help.

Btw, I managed to start your UDFs.

 

 

Share this post


Link to post
Share on other sites

#19 ·  Posted

I fixed my code in post #17. Should work now.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#20 ·  Posted

It does not give an error, but it does not do anything

 

 

Final status
>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\mdogru\Desktop\evden gelen\OutlookEX 1.2.2.0\_OL_ItemModify.au3" /UserParams    
+>17:58:04 Starting AutoIt3Wrapper v.15.920.938.0 SciTE v.3.6.0.0   Keyboard:0000041F  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:041F)
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\mdogru\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\mdogru\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\mdogru\Desktop\evden gelen\OutlookEX 1.2.2.0\_OL_ItemModify.au3
+>17:58:04 AU3Check ended.rc:0
>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\mdogru\Desktop\evden gelen\OutlookEX 1.2.2.0\_OL_ItemModify.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
"C:\Users\mdogru\Desktop\evden gelen\OutlookEX 1.2.2.0\_OL_ItemModify.au3" (17) : ==> Can not initialize a variable with itself.:
Global $oItem = _OL_ItemAttachmentAdd($oOutlook, $oItem, Default, @ScriptDir & "C:\Users\mdogru\Desktop\Yeni klasör (5)\<Y20004222.pdf>")
Global $oItem = _OL_ItemAttachmentAdd($oOutlook, ^ ERROR
->17:58:05 AutoIt3.exe ended.rc:1
+>17:58:05 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 2.154

 

 

 

 

 

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