Skip to content

Commit

Permalink
Tweak name determination
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Jan 15, 2021
1 parent 20637b3 commit 5a1c70f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

* Now recognizes `LastnameFirstname` as sender name format, too.
* Internationalization: Add `FixedReplyAllEnglish()` with a separate template for replies in English.
* In case a sender name takes something in braces at the end, that text is removed (e.g., "Test Name (42)" is converted to "Test Name")

### Fixed

* If sender name is encloded in quotes, these quotes are stripped
* Applied fix by "helper-01" to enable macro usage at 64bit Outlook
* Always use "Firstname Lastname" as sender name, even if some names are formatted "Lastname, Firstname"

## Version [1.5] - 2012-01-11

Expand Down
12 changes: 12 additions & 0 deletions QuoteFixMacro.bas
Original file line number Diff line number Diff line change
Expand Up @@ -993,11 +993,23 @@ Public Sub getNamesOutOfString(ByVal originalName, ByRef senderName As String, B
tmpName = Mid(tmpName, 5)
title = "Dr. "
End If

'Some companies have "(Text)" at the end of their name.
'We strip that
If (Right(tmpName, 1) = ")") Then
pos = InStrRev(tmpName, "(")
If pos > 0 Then
tmpName = Trim(Left(tmpName, pos - 1))
End If
End If

pos = InStr(tmpName, ",")
If pos > 0 Then
'Firstname is separated by comma and positioned behind the lastname
firstName = Trim(Mid(tmpName, pos + 1))
Dim lastName As String
lastName = Mid(tmpName, 1, pos - 1)
senderName = firstName + " " + lastName
Else
pos = InStr(tmpName, " ")
If pos > 0 Then
Expand Down

0 comments on commit 5a1c70f

Please sign in to comment.