Set initial value From field to %USERNAME%?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I want to set the inital value of a From field to
"smtp:%USERNAME%@company.com".

Is this possible? I made an email template in Outlook which shows the from
field. Then I can set the initial value to (e-mail address removed), but I want
Outlook to check the username logged in and put that in front of the @.

Hope my explanation is clear and somebody can help me.

Kind regards,

Lars
 
To do that in a custom form would require custom code, which wouldn't run in an .oft template and wouldn't be an appropriate solution for messages being sent to external recipients.

Maybe you could provide a more detailed description of your scenario and goals.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Ok, first of all thank you for your quick reply and help.

Let me explain the situation. We have different companies with all there own
domain name. We have a Small Business Server 2003 which handles all our
email. So I have (e-mail address removed) and (e-mail address removed) as an emailaddress.

We used Ivasoft software to be able to send from those different
emailadresses. You get a From:-field where you have to type
smtp:[email protected] to send from this address.

I also made a stationairy for each company. In an Outlook template I
combined the stationairy with that companies emailaddress in the From-field.
This is done so its easy for people that work here and they won't make a
misstake. Clients may not know CompanyA belongs to CompanyB and vice versa.

But I want to automate the From-field initial value, because else I have to
make a template for each individual that works here. The emailaddresses are
like (e-mail address removed).

I hope you understand what I'm trying to achieve and you have a solution.

Kind regards,

Lars
 
I hope this to solve the problem.

Put this code inside yout vbscript behind yout form


' Get the username from the Environmet using windows script shell
UserName = "Unknown"
Set WSH_Shell = CreateObject("WScript.Shell") : HandleERR("CreateObj
'WScript.Shell'")
Set WSH_Env = WSH_Shell.Environment("Process") :
HandleERR("WSH_Shell.Environment")
UserName = WSH_Env("USERNAME")
Set WSH_Env = Nothing
Set WSH_Shell = Nothing
 
Outlook doesn't provide any direct waty to do that. You might ask the Ivasoft folks if they can help out.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top