Jump to content

OutlookEX UDF - Help & Support (IV)


water
 Share

Recommended Posts

As the OutlookEX UDF - Help & Support thread has grown too big, I'm starting a new one.
The original thread can be found here.

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

:)

thank you for the prompt response.

  • You can set the profile to be used when calling function _OL_Open, parameter $sProfileName.

What must this $Profilename look like?

I tried to put in my name like this "*my name" - where corresponds with the "account name" in my Outlook.

Global $oOutlook = _OL_Open(False, "", 1000, 1000, "*my name")

Used the * to guarantee a unique name

Got this error...

Error 10, 0

Extended 1003 , 1

:)


Okay, this is not going to work.  Google shows this

Outlook profile
A profile is what Outlook uses to remember the email accounts established within it and the settings that tell Outlook where your email and other data is stored. A new profile is created automatically when you run Outlook for the first time.

That means that the Profile name and any possible email accounts are not the same thing and there can by multiple email accounts inside a given profile.

This changes the nature of the question.  How to select a specific email address from a profile?

Unsurprisingly my Outlook profile is named "Outlook" - it contains seven email addresses...

Edited by Skysnake

Skysnake

Why is the snake in the sky?

Link to comment
Share on other sites

  • 1 month later...

Any reason why Windows Live Mail would truncate PDF attachments?  Tested with Gmail, Thunderbird and Outlook & Outlook for Exchange.  All these work and receive attachments.  Live appears to hide/truncate the attachment... ?

Skysnake

Why is the snake in the sky?

Link to comment
Share on other sites

Is this problem related to the OutllookEX UDF or do you see it as well when you manually open such a mail?

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

Both :)

I sent a PDF  using the UDF to multiple recipients.  All confirmed receipt.  One destination reported that "the email had no attachment" - I sent that directly from Outlook (ie not using the UDF) and also did not receive the PDF attachment.

 

Skysnake

Why is the snake in the sky?

Link to comment
Share on other sites

Which mail format do you use? Text, HTML or RTF?

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

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

  • 3 weeks later...

Hi all,

How to select a signature via your lib ?

My function, but I don't find how to choose signature?

Func Creer_mail($email_destinataire,$sujet,$pj1,$pj2)
   Global $oItem
   Global $oOutlook = _OL_Open()
   If @error <> 0 Then Exit MsgBox(16, "Acacia Dynamic", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended)

   $oItem = _OL_ItemCreate($oOutlook, $olMailItem, "", "", "Subject=" & $sujet, "BodyFormat=" & $olFormatHTML)
   If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemCreate Example Script", "Error creating a mail in folder 'Outlook-UDF-Test\TargetFolder\Mail'. @error = " & @error & ", @extended = " & @extended)
   ; Add a recipient and resolve it
   _OL_ItemRecipientAdd($oOutlook, $oItem, Default, $olTo, $email_destinataire)

   ; Add all attachments
   ;$oItem = _OL_ItemAttachmentAdd($oOutlook, $oItem, Default, @ScriptDir & "\The_Outlook.jpg")
   If $pj1<>"" Then
      $oItem = _OL_ItemAttachmentAdd($oOutlook, $oItem, Default, $pj1)
      If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemCreate Example Script", "Error adding an attachment to a mail in folder 'Outlook-UDF-Test\TargetFolder\Mail'. @error = "  & @error & ", @extended = " & @extended)
   EndIf

   If $pj2<>"" Then
      $oItem = _OL_ItemAttachmentAdd($oOutlook, $oItem, Default, $pj2)
      If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemCreate Example Script", "Error adding an attachment to a mail in folder 'Outlook-UDF-Test\TargetFolder\Mail'. @error = "  & @error & ", @extended = " & @extended)
   EndIf


  $oItem.GetInspector
  $sSignature = $oItem.HTMLBody
  $sBody = "Plop<br>Plip"
  $oItem.HTMLBody = $sBody & $sSignature

   $oItem.Display
   MsgBox(64, "OutlookEX UDF: _OL_ItemCreate Example Script", "Mail with inline picture created.")

   MsgBox(64, "OutlookEX UDF: _OL_ItemCreate Example Script", "All items successfully created in 'Outlook-UDF-Test\TargetFolder' and its subfolders!")

   _OL_Close($oOutlook)
EndFunc

 

Link to comment
Share on other sites

Use function _OL_MailSignatureSet before creating the mail item to set the needed signature.
If needed you could grab the current default signatures using _OL_MailSignatureGet, then set the new signature with _OL_MailSignatureSet, create the mail item and then reset the default signature with the values from _OL_MailSignatureGet.

I will check if there is an easier way to add a specific 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

when I try :

Global $aSignatures = _OL_MailSignatureGet()
   If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_MailSignatureGet Example Script", "Error accessing mail signatures. @error = " & @error & ", @extended: " & @extended)
   _ArrayDisplay($aSignatures, "OutlookEX UDF: All email signatures for the current mail account", "", 0, "|", "Name|Used for new messages?|Used for reply messages?")

I have got an error "Error accessing mail signatures. @error = 1, @extended: -2147221005

Idem for _OL_MailSignatureSet

Signature 'Outlook-UDF-Test' could not be set. @error = 1, @extended: -2147221005

Can You help me?

Link to comment
Share on other sites

Is Microsoft Word installed on the computer where you run the 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

That causes the error message you see.
Outlook uses MS Word as the editor for Signatures.

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

ok,

I have made a loop create 50 mails with the same function.

Some time I have Error creating mail in folder @error=4,  @extended: -2147221005

And when this error occur I must reboot my pc, and all become ok.

Why ?

My function

Func Creer_mail($oOutlook,$email_destinataire,$sujet,$pj1,$pj2,$chem_modele_html)
   Global $oItem

   $oItem = _OL_ItemCreate($oOutlook, $olMailItem, "", "", "Subject=" & $sujet, "BodyFormat=" & $olFormatHTML)
   If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemCreate Example Script", "Error creating a mail in folder 'Outlook-UDF-Test\TargetFolder\Mail'. @error = " & @error & ", @extended = " & @extended)


   ; Add a recipient and resolve it
   If $email_destinataire<>"" Then
   _OL_ItemRecipientAdd($oOutlook, $oItem, Default, $olTo, $email_destinataire)
   EndIf

   ; Add all attachments
   If $pj1<>"" Then
      $oItem = _OL_ItemAttachmentAdd($oOutlook, $oItem, Default, $pj1)
      If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemCreate Example Script", $pj1 & "Error adding an attachment to a mail in folder 'Outlook-UDF-Test\TargetFolder\Mail'. @error = "  & @error & ", @extended = " & @extended)
   EndIf

   If $pj2<>"" Then
      $oItem = _OL_ItemAttachmentAdd($oOutlook, $oItem, Default, $pj2)
      If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemCreate Example Script", $pj2 & "Error adding an attachment to a mail in folder 'Outlook-UDF-Test\TargetFolder\Mail'. @error = "  & @error & ", @extended = " & @extended)
   EndIf


  $oItem.GetInspector

  $sBody =  $chem_modele_html
  $oItem.HTMLBody = $sBody

EndFunc

An his call

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

$sBody="AA<br>bb"

For $i=0 To 99
    Creer_mail($oOutlook,$i & "a@a.com","Invoide s","C:\Users\vmware\Desktop\exporteur\3 Facturation\2017\201712\201712 - Facturation ddd - Synthese.pdf","C:\Users\vmware\Desktop\exporteur\3 Facturation\2017\201712\201712 - Facturation ddd.pdf",$sBody)
Next
_OL_Close($oOutlook)

 

Link to comment
Share on other sites

That's the same error as in post #17. Do you by any chance call the signature function which needs MS Word?

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

The following lines

$oItem.Getspector

  $sBody =  $chem_modele_html
  $oItem.HTMLBody = $sBody

can be written as

;  $oItem.GetinInspector
  $oItem.HTMLBody = $chem_modele_html

I'm not sure GetInspector is needed any longer.

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

Version 1.3.2.0 of the UDF has been released.

Please test before using in production!

For download please see 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

My bad :>
You know there is a typo in your code and your last post? It should be:  $oItem.GetInspector

What happens when you add a Sleep(500) into the loop before sending each mail?

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

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
 Share

×
×
  • Create New...