We help IT Professionals succeed at work.

Userprofile rather than UserName

SparkyP
SparkyP asked
on
mbizup very kindly sorted out getting a signature on an E-mail sent using code in VBA. (01/12/11 10:24 AM, ID: 37218850)

This works fine when the user profile name is the same as the usrename, however, we have several members of staff with their profile being just the forename (with the username being the full name).

Can the following code be adapted to pick up the users profilename?

SigString = "C:\Users\" & Environ("userName") & "\appdata\Roaming\Microsoft\Signatures\irs.htm"

Many Thanks
Comment
Watch Question

Commented:
Try

SigString = Environ("USERPROFILE") & "\appdata\Roaming\Microsoft\Signatures\irs.htm"

Author

Commented:
Fantastic. What a difference leaving out  c:\User makes!!

Thanks for your speedy response