![]() |
|
|
|
#1
|
|||
|
|||
|
Hi all,
I'm sure this has been asked before but I can't find it on this fine forum! I am new to using mergefields and I am hoping to do some manipulation on the data within one. I have a field that contains employee names i.e. "Firstname Lastname" and I know that the standard form for company email addresses is "firstname.lastname@companyname.co.uk". My question is is there a way within mergefield if formulas to automatically format the name field to an email field i.e. replace the space with a "." and add the email url at the end? Thanks in advance. Regards Tom |
|
#2
|
||||
|
||||
|
A mailmerge cannot perform a Find/Replace (i.e. to replace the space with a period); aside from that showstopper, it's quite possible to turn the string into a working email address.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#3
|
|||
|
|||
|
Hi mate thanks for the info would that be done within VB?
|
|
#4
|
||||
|
||||
|
Sure, you can do lots of things with VBA, but then it ceases to be a mailmerge and you have to replicate your entire mailmerge logic etc. in the vba code.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#5
|
|||
|
|||
|
Hi Pal,
Did you have a suggestion that wasn't VBA? Purely because I don't want to have to make the documents macro enabled if I don't have to. Thanks Tom |
|
#6
|
||||
|
||||
|
Well, you did ask about a VB...
Assuming you can do your merge setup so it outputs: Code:
firstname lastname@companyname.co.uk Find = (<[A-Za-z0-9]@>) (<[A-Za-z0-9]@>\@[A-Za-z0-9.]{1,}) Replace = \1.\2 to turn all those strings into: Code:
firstname.lastname@companyname.co.uk
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#7
|
|||
|
|||
|
Yeah apologies for the confusion, thanks for that info. The email address does not need to be clickable just displayed so it looks like that would work!
Thanks Tom |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Combining Characters in Find & Replace
|
Surge | Word | 6 | 03-10-2020 12:42 AM |
Replace All -- inserting a space between two non-consistent characters
|
knpaddac | Word | 1 | 01-30-2018 12:52 PM |
Replace characters in a string
|
Anthon | Excel Programming | 1 | 11-03-2016 12:48 AM |
| Use wildcards to replace some characters | mauuuuu5 | Excel | 2 | 12-12-2015 07:27 PM |
Find and Replace some characters with Bullets
|
kjxavier | Word | 1 | 01-02-2015 12:15 AM |