Convert name (first name and last name) to initials

S

Sally Green

Word 2003
i have a user form with text boxes for names. Using code I need to use
these names thoughout the document. But on one occasion I need to take the
name entered into the text box and convert it to initials.

eg entered name Joe bloggs.
i need to use Joe Bloggs and also use JB.

how do I take the first character of two separate words?

Thanks
 
D

Doug Robbins - Word MVP

Use

Dim strName As String, strInitials As String
strName = "Joe Blogs"
strInitials = Left(strName, 1) & Mid(strName, InStr(strName, " ") + 1, 1)
MsgBox strInitials


--
Hope this helps

Doug Robbins - Word MVP
Please reply only to the newsgroups unless you wish to avail yourself of my
services on a paid, professional basis.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top