Jump to content

OutlookEX UDF - Help & Support (III)


water
 Share

Recommended Posts

hello all,

is it possible using the OutlookEX UDF, to store in an array the items properties like its body, subject, attachments. Basically everything about that mail item and transfer that to another autoit script running on another computer with outlook so as to make an exact copy of that mail item(sync) between two outlook?

If yes does any of you have examples/materials i can look upon?

other solutions doing that sync type of outlook(s) are not compatible with unicode messages or open source solutions are heavily coded/feature bloated so just started thinking in doing it with autoit.

tried to read all of the OutlookEX UDF functions until my mind totaly blocked.

I looked upon the ItemExport, ItemImport, ItemSave functions but I cant figure out how to convert the object to an array

so to transfer it through tcpsend. One other possible solution I also looked upon was that I could save to a temp PST file all the items that I want and just transfer that file to the computer with the outlook that needs to be sync'ed.

If anyone has any ideas how this can be made possible please tell me so.

thanks in advance for your help!

Simon

Link to comment
Share on other sites

Are you talking about a one time sync of selected mail items or do you need a continous sync of the two Outlook instances?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

sorry for the delay, propably the continuous sync that is when I press the sync or whatever button at the end of the day I want some of my outlook instances here at my work to be in sync and those 2-3 computers with outlook have exact same inbox/sent mails. What's missing from me is a way to import the .MSG unicode files(email + attachments) or a way to transfer the object vItem that is in ItemCopy function to another computer through networking. The rest I can glue them together. ^_^

Link to comment
Share on other sites

I can imagine to have a PST file on a network share and copy the needed items to this archive. Or do you need to write to this PST file from any of your computers?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

If I do it with a PST file then I guess I'll share the PST file on my server and then i'll access it from each autoit script each time I need to make the sync between them. 1 primary instance of outlook will make changes on any emails and copy them to PST file and then the rest instances will make copies OR replacements of those mailitems in need. okay figure it out. thanks for the help water!

Link to comment
Share on other sites

I have never tested if a PST file can be opened by more than one instance at a time. Maybe you run into file locking issues.

Then we need to think about other solutions. Maybe Exchange Mailbox sharing?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I've had a look at the OutlookEX udf but cannot understand much as I'm not so proficient in programming, but I hope I'm in the right place for this.

What I basically need is AutoIt to constantly monitor and automatically read every incoming email and search in the email body for a specific string. Perhaps reading the whole email body and put it into a variable? Similar to what something like $var = _INetGetSource() can do perhaps. Then I can do StringInStr on this variable?

Link to comment
Share on other sites

This means you have to handle events.

I'm on vacation right now so I can't tell you any details.

The UDF comes with some examples handling events. You can find them in the examples thread. For the link please check my signature.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Water,

do you have any idea why my recall function is always failed?

Subject:    Recall: test

      Sent: 22-Jun-14 8:16 AM

cannot be recalled on 22-Jun-14 8:16 AM.

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Link to comment
Share on other sites

Do you recall manually or by script?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I recall manually and planning to make a script but recalling manually always gives me message recall failure... I googled it but cant find the right answer...

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Link to comment
Share on other sites

Does Outlook connect to an Exchange server?

Did recalling ever work before?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I dont know about the exchange server, but i think yes because we are using company email, POP/SMTP.

Recall function, worked once for 1 email add(outlook) only, but sent it to 10 email add(outlook). and tried to recall to the same email that worked before and it failed, again and again..

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Link to comment
Share on other sites

I only used recall a few times. Sometimes it worked, sometimes it didn't.

I can't tell if this is expected behavior or not.

More error information would be required.

Right now I'm on vacation but will have a look next week.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Here is the fixed function. Simply replace the function in the UDF:

Func _OL_ItemRecipientAdd($oOL, $vItem, $sStoreID, $iType, $vP1, $vP2 = "", $vP3 = "", $vP4 = "", $vP5 = "", $vP6 = "", $vP7 = "", $vP8 = "", $vP9 = "", $vP10 = "", $bAllowUnresolved = True)

    Local $oRecipient, $aRecipients[10], $oTempRecipient
    If Not IsNumber($iType) Then Return SetError(5, 0, 0)
    If Not IsObj($vItem) Then
        If StringStripWS($vItem, 3) = "" Then Return SetError(1, 0, 0)
        $vItem = $oOL.Session.GetItemFromID($vItem, $sStoreID)
        If @error Then Return SetError(2, @error, 0)
    EndIf
    ; Move members into an array
    If Not IsArray($vP1) Then
        $aRecipients[0] = $vP1
        $aRecipients[1] = $vP2
        $aRecipients[2] = $vP3
        $aRecipients[3] = $vP4
        $aRecipients[4] = $vP5
        $aRecipients[5] = $vP6
        $aRecipients[6] = $vP7
        $aRecipients[7] = $vP8
        $aRecipients[8] = $vP9
        $aRecipients[9] = $vP10
    Else
        $aRecipients = $vP1
    EndIf
    ; add recipients to the item
    #forceref $oTempRecipient ; to prevent the AU3Check warning: $oTempRecipient: declared, but not used in func.
    For $iIndex = 0 To UBound($aRecipients) - 1
        ; recipient is an object = recipient name already resolved
        If IsObj($aRecipients[$iIndex]) Then
            $oTempRecipient = $vItem.Recipients.Add($aRecipients[$iIndex])
            If @error Then Return SetError(3, $iIndex, 0)
            $oTempRecipient.Type = $iType
        Else
            If StringStripWS($aRecipients[$iIndex], 3) = "" Then ContinueLoop
            $oRecipient = $oOL.Session.CreateRecipient($aRecipients[$iIndex])
            If @error Or Not IsObj($oRecipient) Then Return SetError(600 + $iIndex, @error, 0)
            $oRecipient.Resolve
            If @error Or Not $oRecipient.Resolved Then
                If Not (StringInStr($aRecipients[$iIndex], "@")) Or Not ($bAllowUnresolved) Then Return SetError(400 + $iIndex, @error, 0)
            EndIf
            $oTempRecipient = $vItem.Recipients.Add($oRecipient)
            If @error Then Return SetError(300 + $iIndex, @error, 0)
            $oTempRecipient.Type = $iType
        EndIf
    Next
    $vItem.Save()
    Return $vItem

EndFunc ;==>_OL_ItemRecipientAdd
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

hmm, thanks water, but that doesnt seem to work :(... the cc recipients still go into the To: field.

EDIT: seems that this only happens if you add To: recipients first and the Cc recipients.  If you add Cc recipients first then To recipients it appears to work properly!

Edited by mpower
Link to comment
Share on other sites

Can you please post the code you run?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...