Userform

G

Guest

Hi

I am creating new templates for faxes, emails etc with pop-up userforms on
open.

Does anyone know how to get user information to generate on the userform.

Im not talking about the user info under word/tools/options/user info.

Im after whoever is logged onto the PC etc. Their
Username,Title,Company,PhoneNo and email address.

When a new doc is opened using the template, the userform opens up with this
info already displayed. The user can edit before selecting ok. Then all info
off the userform is loaded into the relevant bookmarks in the doc.

Any help appreciated

Ta
 
J

Jezebel

Username has a couple of meanings. The information on the Tools > Options >
User Information tab is available through Application.UserName and
Application.UserAddress.

If you want the Windows login UserName, use the GetUserName API --

Private Declare Function GetUserName Lib "advapi32.dll" Alias
"GetUserNameA"(ByVal lpBuffer As String, nSize As Long) As Long

The other values you're after -- Title,Company,PhoneNo and email address --
aren't necessarily available anywhere. You'll need to prompt for them the
first time, then save them for subsequent use. There are any number of
places you could save them -- Registry, Document properties or variables in
normal.dot, an INI (or any other kind of) file, etc.
 

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

Similar Threads


Top