[GH-ISSUE #13] .txt signatures contain additional blank lines #5

Closed
opened 2026-02-27 20:30:45 +03:00 by kerem · 2 comments
Owner

Originally created by @GruberMarkus on GitHub (Sep 8, 2021).
Original GitHub issue: https://github.com/Set-OutlookSignatures/Set-OutlookSignatures/issues/13

When using .docx template files, the resulting text-only signature (.txt file) has additional blank lines at the end.

These blank lines do not appear when using .htm template files.

The problem is reproducable with the latest version (v2.1.2) of the script, the attached sample templates in .docx format can be used to demonstrate the problem.

Originally created by @GruberMarkus on GitHub (Sep 8, 2021). Original GitHub issue: https://github.com/Set-OutlookSignatures/Set-OutlookSignatures/issues/13 When using .docx template files, the resulting text-only signature (.txt file) has additional blank lines at the end. These blank lines do not appear when using .htm template files. The problem is reproducable with the latest version (v2.1.2) of the script, the attached sample templates in .docx format can be used to demonstrate the problem.
kerem closed this issue 2026-02-27 20:30:45 +03:00
Author
Owner

@GruberMarkus commented on GitHub (Sep 8, 2021):

Problem confirmed.

Additional lines are only added when using templates in .docx format, because the script uses .docx to create the other formats - and Word adds additional lines at the end of the file when converting from .docx to .txt.

The Word behavior can easily be reproduced manually:

  1. Create a new .docx file and open it in Word
  2. Save the .docx file as .txt file and close Word
  3. Open the newly created .txt file and compare the line count with the initial .docx file. The .txt file has additional lines.

I could not find an official statement or documentation from Microsoft, but the information from https://eileenslounge.com/viewtopic.php?t=16703 seems valid.

When creating a new signature directly in Outlook, the conversion to .txt happen automatically and without adding additional lines. This is because Outlook does not convert from .docx to .txt, but from .htm to .txt.

The next version of the script (probably v2.2.0) will have a simple solution for this problem by adopting the Outlook behavior: Conversion to .txt will no longer be based on the original .docx file, but on the .htm file createad from the .docx template.

<!-- gh-comment-id:915096494 --> @GruberMarkus commented on GitHub (Sep 8, 2021): Problem confirmed. Additional lines are only added when using templates in .docx format, because the script uses .docx to create the other formats - and Word adds additional lines at the end of the file when converting from .docx to .txt. The Word behavior can easily be reproduced manually: 1. Create a new .docx file and open it in Word 2. Save the .docx file as .txt file and close Word 3. Open the newly created .txt file and compare the line count with the initial .docx file. The .txt file has additional lines. I could not find an official statement or documentation from Microsoft, but the information from https://eileenslounge.com/viewtopic.php?t=16703 seems valid. When creating a new signature directly in Outlook, the conversion to .txt happen automatically and without adding additional lines. This is because Outlook does not convert from .docx to .txt, but from .htm to .txt. The next version of the script (probably v2.2.0) will have a simple solution for this problem by adopting the Outlook behavior: Conversion to .txt will no longer be based on the original .docx file, but on the .htm file createad from the .docx template.
Author
Owner

@GruberMarkus commented on GitHub (Sep 8, 2021):

Fixed in release v2.2.0.

<!-- gh-comment-id:915277212 --> @GruberMarkus commented on GitHub (Sep 8, 2021): Fixed in release [v2.2.0](https://github.com/GruberMarkus/Set-OutlookSignatures/releases/v2.2.0).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Set-OutlookSignatures-Set-OutlookSignatures#5
No description provided.