# Microsoft Outlook default signature

**URL:** <https://clarionhub.com/t/microsoft-outlook-default-signature/7760>\
**Category:** questions\
**Tags:** com, email\
**Created:** [December 19, 2024, 2:33pm UTC](https://clarionhub.com/t/microsoft-outlook-default-signature/7760 "2024-12-19T14:33:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![henkouwejan](https://clarionhub.com/letter_avatar_proxy/v4/letter/h/7ea924/32.png) [@henkouwejan](https://clarionhub.com/u/henkouwejan)\
**Post date:** [December 19, 2024, 2:33pm UTC](https://clarionhub.com/t/microsoft-outlook-default-signature/7760/1 "2024-12-19T14:33:14Z")

</div>

Hi all,

For sending emails from my Clarion app I use an OLE control with a piece of VB script. This works fine, but the default (MS Outlook) signature in the body is missing. I read on stack overflow that this will be placed in the body. But not tin my case. I may be missing perhaps one line of code to fill the body with the preferred signature from Outlook.

Does anyone have a suggestion?

VB script:

```clarion
?OleOutlook{'Application.Visible'} = True
?OleOutlook{PROP:Create}='outlook.application'
OutMail=?OleOutlook{'createItem(0)'}
IF OutMail[1]<>'`'
    MESSAGE('Cannot send a message by Microsoft Outlook.','Error',ICON:Hand)
ELSE
    ?OleOutlook{OutMail&'.Subject'} = 'Your invoice 123456'
    ?OleOutlook{OutMail&'.To'} = 'somebody@domain.com'
    ?OleOutlook{OutMail&'.HTMLbody'} = ??????
    ?OleOutlook{OutMail&'.Attachments.Add('&Invoice123456.PDF&')'} 
    ?OleOutlook{OutMail&'.Display'}
END
?OleOutlook{'Application.Display'} = True
?OleOutlook{'Application.Visible'} = True

```

Regards,

Henk Ouwejan

---

<div class="post-metadata">

**Author:** ![Mark\_Sarson](https://clarionhub.com/user_avatar/clarionhub.com/mark_sarson/32/6132_2.png) [@Mark\_Sarson](https://clarionhub.com/u/Mark_Sarson)\
**Post date:** [December 19, 2024, 3:40pm UTC](https://clarionhub.com/t/microsoft-outlook-default-signature/7760/2 "2024-12-19T15:40:30Z")

</div>

Hi Henk,

I asked ChatGPT, and it suggested that the issue might be due to how the Outlook Object Model handles signatures. When setting the `HTMLBody` or `Body` property, Outlook replaces the entire email content, including the signature. Obviously GPT has also been known to be wrong.

Below is the adjusted code incorporating the suggestion to include the signature by appending custom content to the existing body:

```clarion
?OleOutlook{'Application.Visible'} = True
?OleOutlook{PROP:Create} = 'outlook.application'
OutMail = ?OleOutlook{'createItem(0)'}
IF OutMail[1] <> '`'
    MESSAGE('Cannot send a message by Microsoft Outlook.', 'Error', ICON:Hand)
ELSE
    ExistingBody = ?OleOutlook{OutMail & '.HTMLBody'} ! Retrieve the existing content, which includes the signature
    IF LEN(ExistingBody) = 0
        MESSAGE('Default signature not found.', 'Warning', ICON:Exclamation)
    END

    NewContent = '<p>Your invoice 123456</p>' ! Add your custom content here
    ?OleOutlook{OutMail & '.Subject'} = 'Your invoice 123456'
    ?OleOutlook{OutMail & '.To'} = 'somebody@domain.com'
    ?OleOutlook{OutMail & '.HTMLBody'} = NewContent & ExistingBody ! Append your content to the signature
    ?OleOutlook{OutMail & '.Attachments.Add(' & Invoice123456.PDF & ')'}
    ?OleOutlook{OutMail & '.Display'}
END
?OleOutlook{'Application.Display'} = True
?OleOutlook{'Application.Visible'} = True

```

**Tip for Posting Code on the Forum** :  
When posting clarion code on the forum, you can format it for better readability by wrapping it with three backticks ``` followed by the word `clarion` at the start and three backticks at the end. For example:  
```clarion  
! Your Clarion code here  
``` becomes.

```clarion
! Your Clarion code here

```

Mark

---

<div class="post-metadata">

**Author:** ![henkouwejan](https://clarionhub.com/letter_avatar_proxy/v4/letter/h/7ea924/32.png) [@henkouwejan](https://clarionhub.com/u/henkouwejan)\
**Post date:** [December 19, 2024, 4:15pm UTC](https://clarionhub.com/t/microsoft-outlook-default-signature/7760/3 "2024-12-19T16:15:59Z")

</div>

Hello Mark,

Thank you for the tip for displaying readable Clarion code (much better 🙂 )

The HTMLBody was still empty. The third ChatGPT solution I got (ChatGTP is my new friend) this:

```clarion
! Add signature (Outlook will do this for you)
?OleOutlook{OutMail&'.Display'}

```

This code must before: ExistingBody =

And now it works

---

<div class="post-metadata">

**Author:** ![FoucheRabie](https://clarionhub.com/letter_avatar_proxy/v4/letter/f/7cd45c/32.png) [@FoucheRabie](https://clarionhub.com/u/FoucheRabie)\
**Post date:** [September 12, 2025, 10:39am UTC](https://clarionhub.com/t/microsoft-outlook-default-signature/7760/4 "2025-09-12T10:39:11Z")

</div>

Hi Henk,  
Does this/your ole script work with the NEW Outlook?

I have been using a VBS script for years, But the New Outlook does not respond to it.

F

---

<div class="post-metadata">

**Author:** ![FoucheRabie](https://clarionhub.com/letter_avatar_proxy/v4/letter/f/7cd45c/32.png) [@FoucheRabie](https://clarionhub.com/u/FoucheRabie)\
**Post date:** [September 12, 2025, 12:00pm UTC](https://clarionhub.com/t/microsoft-outlook-default-signature/7760/5 "2025-09-12T12:00:12Z")

</div>

it appears not possible any more…  
Bing search _“Is there a VB script that works with the new outlook?”_  
Result: 😟

> Unfortunately, the **new Outlook for Windows** does not support the Outlook Object Model, which means it cannot be automated using VBScript. This is a significant change from the classic Outlook, where VBScript could be used for automation tasks. Additionally, the new Outlook does not include support for VBA or other developer tools.
> 
> If you need automation or scripting capabilities, you might consider the following alternatives:
> 
> 1. **Microsoft Graph API** : This is a modern and robust way to interact with Microsoft 365 services, including Outlook. It allows you to perform tasks like sending emails, managing calendars, and more, but it requires programming knowledge in languages like Python, JavaScript, or C#.

Hmm, 🤔

So, we will have to go in another direction?  
What i am trying to achieve.

1. Generate the body in HTML format. (Clarion process)
2. Generate the quote.pdf for the attachment. (Clarion Process)
3. Click the button to Email. which will formulate the TO, SUBJECT Line, add ATTACHEMENTs and load the BODY-HTML file. (Clarion Process)  
Present /open this NEW EMAIL WINDOW to the user to review before they press SEND.

Any OTHER suggestions?

F

---

<div class="post-metadata">

**Author:** ![Mike\_Duglas](https://clarionhub.com/user_avatar/clarionhub.com/mike_duglas/32/1061_2.png) [@Mike\_Duglas](https://clarionhub.com/u/Mike_Duglas)\
**Post date:** [September 12, 2025, 7:04pm UTC](https://clarionhub.com/t/microsoft-outlook-default-signature/7760/6 "2025-09-12T19:04:19Z")

</div>

> [@FoucheRabie](#):
>
> Microsoft Graph API

Yes, " _Microsoft Graph_ is the gateway to data and intelligence in Microsoft cloud services like Microsoft Entra and Microsoft 365."

---

<div class="post-metadata">

**Author:** ![Jos\_van\_Bragt](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/a8b319/32.png) [@Jos\_van\_Bragt](https://clarionhub.com/u/Jos_van_Bragt)\
**Post date:** [October 21, 2025, 1:47pm UTC](https://clarionhub.com/t/microsoft-outlook-default-signature/7760/7 "2025-10-21T13:47:16Z")

</div>

How did you connect the ole control in Clarion? I am struggling with word and want to try it by OLE

---

<div class="post-metadata">

**Author:** ![henkouwejan](https://clarionhub.com/letter_avatar_proxy/v4/letter/h/7ea924/32.png) [@henkouwejan](https://clarionhub.com/u/henkouwejan)\
**Post date:** [November 6, 2025, 8:55am UTC](https://clarionhub.com/t/microsoft-outlook-default-signature/7760/8 "2025-11-06T08:55:31Z")

</div>

> [@Jos\_van\_Bragt](#):
>
> t

Just put an OLE contol on your Window. You will get the control named ?OLE.  
Make this contol hidden and you can use ?OLE{PROP: …

Regards Henk
