Open Stonywall opened 3 years ago
When attribute value is empty for example Tel. {Telephone} it can delete entire line?
Hi @Stonywall, thanks for the code (sorry for the delayed reply!). When I was testing the Outlook process would close when the Word process was closed unless it had been opened already. But there maybe cases where this doesn't happen as you have seen. Checking if the Outlook window is active and then force closing seems like a good solution, ill try and test it out myself and update the script.
@ajaigc there is a variable in the script that does what you need, set $EnableDeleteEmptyTagLine
to $true
Hi Chris,
Not exactly, Below is a sample of our signature template
{initials} {givenname} {sn} {title}
Tel. {telelphonnumber} | Cell {mobile} | {mail}
In this scenario when set $EnableDeleteEmptyTagLine to $true some users don’t want to show cell no in the signature then it removes complete line.
Also when {initials} is empty the text is not left aligned there is a blank space to the left.
With the help of a developer we modified a bit to meet our requirements
@.***D72EB5.32C6B300]
Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10
From: Chris @.> Sent: 07 April 2021 03:10 To: @.> Cc: @.>; @.> Subject: Re: [chrisred/posh-scripts] OutlookSignatureScript.ps1 | additional code for running outlook process (#10)
Hi @Stonywallhttps://github.com/Stonywall, thanks for the code (sorry for the delayed reply!). When I was testing the Outlook process would close when the Word process was closed unless it had been opened already. But there maybe cases where this doesn't happen as you have seen. Checking if the Outlook window is active and then force closing seems like a good solution, ill try and test it out myself and update the script.
@ajaigchttps://github.com/ajaigc there is a variable in the script that does what you need, set $EnableDeleteEmptyTagLine to $true
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/chrisred/posh-scripts/issues/10#issuecomment-814456578, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATL3ETEFKASCPXWRWDE7SKDTHN5WBANCNFSM4UV36DJA.
When the script runs and Outlook is not open, it doesn't gracefully close Outlook after writing the new signature files.
I have made an addition to the code at the end to check if the process is interactive (the end user has Outlook open) or if it is "non-interactive" (the script opened it and there is no GUI interface). If it is "non-interactive", it will close all "Outlook" processes it finds, thus allowing the end user to launch Outlook.
Original Code
With New Code Addition