Jump to content
water

OutlookEX UDF

Recommended Posts

So maybe there could be a function to replace the current lines? Something like this: (and maybe more conditions... I'm not sure what other item types are compatible)

If $oSourceFolder.DefaultItemType <> $vTargetFolder.DefaultItemType Then Return SetError(2, 0, 0)
; ... Goes to ...
If Not __OL_DefaultItemTypeMatch($oSourceFolder.DefaultItemType, $vTargetFolder.DefaultItemType) Then Return SetError(2, 0, 0)

Func __OL_DefaultItemTypeMatch($iSource, $iDest)
    
    If ($iSource = $olMailItem) And ($iDest = $olPostItem) Then
        Return True
    Else
        Return $iSource = $iDest
    EndIf
    
EndFunc

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Share this post


Link to post
Share on other sites

This line will be removed. A folder can hold different item types so it doesn't make sense to insist on the default item types.
That simply shows my limited knowledge of how Outlook works ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-10-24 - Version 1.4.14.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (NEW 2019-11-07 - Version 1.3.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Dear water,

26 I ran the script in nolo message, but I did not get a result, the last case is as follows, let's continue.
Have a nice day with your help.

:) feel you'll reach the result.

Adsız.jpg

Share this post


Link to post
Share on other sites

When you have downloaded the latest OutlookEX UDF (version 1.3.6.0) then function _OL_StoreGet will show you if a store is Conversation enabled.
Please run _OL_StoreGet.au3 and you will get this information in column 16 (starting from 1).
_OL_ConversationGet will only work with Conversation enabled stores.

How many conversation items (mail etc.) did you expect?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-10-24 - Version 1.4.14.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (NEW 2019-11-07 - Version 1.3.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hey water, just wondering if you're planning on changing the Folder.DefaultItemType matching in the functions. I just downloaded the new version and the lines are still in there :) I created a "My_OL_ItemCopy" function to avoid the issue for now


All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Share this post


Link to post
Share on other sites

I have already modified the function (by removing a line of code) but haven't released this version yet.
For the time being you could simply comment the line in your UDF file.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-10-24 - Version 1.4.14.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (NEW 2019-11-07 - Version 1.3.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I'm looking for a way to automate the creation of a pst file and to move the calendar and contacts from the default OST data file into the new pst file.  The reason for wanting to do this is because I'm looking for a way to back up users OST files (Outlook 2016 running on Win10) that are connecting to our IMAP server.  As we all know you can't simply backup the OST file and restore it should you wish to, there's also little point backing up the majority of the OST file as it's a cache of the IMAP server.  The problem is that the OST file now bundles in the users calendar and contacts, in their default data file.  By creating a new PST data file and setting it to the users default data file, the calendar and contacts can then be moved from within Outlook.  This PST file can then be backed up and restored successfully. 

 

Looking on the Outlookex pages I _think_ it can do what I want using functions like _OL_ItemExport.  I'm just not sure where to really begin with this project.  I did copy an example using _OL_ItemExport into Scite just to see if I could list my Outlook folders but even opening Outlook seemed to give a problem, not sure why:

 

#include <OutlookEX.au3>
#include <Array.au3>
#include <File.au3>

SplashTextOn("Please wait","Mailbox sync in progress." & @CRLF & @CRLF & "If a window asking for your ID and password pops-up," & @CRLF & "please enter them and click on OK." & @CRLF & @CRLF & "Once you entered your ID and password or if they were not asked," & @CRLF & "please do not use your computer while this window is showing." & @CRLF & @CRLF & "Sync time is approximatively around 1 min.",600,215,-1,-1,18)

$outlook = _OL_Open(True)
ConsoleWrite ("$outlook = '" & $outlook & "' with error '" & @error & "'" & @CRLF)

sleep(2000)

$pst = _OL_PSTCreate($outlook, @UserProfileDir & "\exchangebackup\exchangebackup.pst", "Exchange backup ")

ConsoleWrite ("$pst = '" & $pst & "' with error '" & @error & "'" & @CRLF)

sleep(2000)

_OL_ItemSync($Outlook)

_OL_ItemSendReceive($Outlook)

$folders = _OL_FolderTree($outlook, "*") ;first use of FolderTree is needed to force sync with Exchange server

The console gave:

$outlook = '0' with error '5'
$pst = '0' with error '2'

which looks like an error to me.  No pst file was created.

 

Any guidance to help me do this?

 

Thanks

Share this post


Link to post
Share on other sites

@error = 5 by _OL_Open stands for "File $sWarningProgram does not exist. Has to be an executable that can be startet using the run command".

You are sure you posted the script you run as this parameter is missing in your code?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-10-24 - Version 1.4.14.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (NEW 2019-11-07 - Version 1.3.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

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

×
×
  • Create New...