PDA

View Full Version : users email address link in word



Trevor
04-08-2008, 08:46 AM
Is there a way to add the loggedin user's Email address (from Outlook) without declaring all the variables you would need to declare in Access? (I know I need the referrence to Outlook X.0 lib
I was going to use the outlook SendFrom proporty to get the email address, does anyone have any "better" Ideeas?
the reason for this is to putt the users email address as a link at the bottom of the latter so the recipiant can click on it and email that user.
How do I use the onload proporty in word? is it:

Private Sub Document_Onload()
[code]
EndSub

Thanks for helping

fumei
04-09-2008, 10:19 AM
There is no OnLoad in Word.

There is a Document_Open event.

I am rather unsure of what you are talking about.

" putt the users email address as a link at the bottom of the latter"

Except...I have NO idea what "the latter" is.

Huh?

Trevor
04-09-2008, 11:50 AM
its going to be a blank doc that the user types a letter in, so I just need to insert the user's Email address (the user logged in to pc) on the page as a link so as the user types the email address link moves down the page
ie: the link starts on line 2 of the doc and as the user hits return to type a new line the email address link then moves down the page so if the link started on line 2 and the user hit enter the link would now be on line 3.
I hope this helps, thanks for your reply(I'm trying to branch out from access :beerchug:

Trevor
04-09-2008, 11:52 AM
or maybe even a better idea would be instead of the link would be to place the user's outlook signiture at the bottom insead. thanks (just rememberd everyone here has an OE Signiture( I personal don't use outlook)

jasoncw
04-09-2008, 12:08 PM
I'm not sure how to determine the full email address, but you can determine the user's Windows login user id with the following:
sUserID = Environ("UserName")
If this is all in the same company, and Outlook is on an Exchange server, the Windows logon can sometimes also be the Outlook email user id. So if the login id is john.smith, then you can obtain the user id with the above code, then append it with the domain:
emailAddr = sUserID & "@work.com"
Hopefully that can help you. If not, someone else will chime in.

Jason

Trevor
04-09-2008, 12:31 PM
I don't have access to the exchange server, and the email address in't always username@domain.com, that is why I need to use the local OL account

mdmackillop
04-15-2008, 12:04 AM
Why not use a template for each user? If you want further automation, the Document-New event can be used to insert text or Autotext.

Trevor
04-15-2008, 03:36 PM
the reason for not using a templete per user is they want to be able to send the doc out and who ever authers the document text there email (I think email signiture from out look would work beter) will appear at the bottom of the doc
so a templete that adds the outlook signiture to the bottom of the doc, this corporatio has 1,000's of member