Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Personalized greeting

  Asked By: Sally    Date: Feb 28    Category: Sharepoint    Views: 2254

How can I display the name of the user logged on to the portal site? E.g.

Welcome, Arlynn Atienza.

will be displayed after I log in to the portal site.



3 Answers Found

Answer #1    Answered By: Daya Sharma     Answered On: Feb 28

Don't know if you got a solution for this one yet but here is a rough code
snippet... Hope this is a start. On my SharePoint server, it comes up and
say's "Welcome, ..." with the login user's name. (Note, this is just a
slightly modified code from the Today Date DWP. Nothing complex here.)

Create a new webpart..
Give it a name...
In advanced...
Select VBScript for the content...
Paste this code in the embedded content...

Function getContent(node)

Dim strContent

strContent = "<DIV style=""font-size: 150%"">"
strContent = strContent & "Welcome, "
strContent = strContent & GetServerVariable("LOGON_USER")
strContent = strContent & "."
strContent = strContent & "</DIV>"
strContent = strContent & "<HR>"

getContent = strContent

End Function

Answer #2    Answered By: Nikunj Kansagara     Answered On: Feb 28

Thank you for the this web part is there any other you like to share.
Plus how can I change colors for the users name?

Answer #3    Answered By: Noel Benson     Answered On: Feb 28

Sure, to change color simply insert the necessary HTML tags...

Replace the line with this...
strContent = strContent & "<font color=""#FF0000"">" &
GetServerVariable("LOGON_USER") & "</font>"

Will make the name red. The color is RGB & Hex. (RRGGBB) So FF0000 is
red. 00FF00 is green, etc. Of course you can mix colors, and be sure to
convert the decimal to hex. (FF - 255 is max)

As far other web parts, nope not yet. I'm just starting to really code
them, starting off with some tests doing ADO/LDAP connectivy from a webpart.

Anyone, who has any code that may be of some use please post it! Thanks.

Didn't find what you were looking for? Find more on Personalized greeting Or get search suggestion and latest updates.