get user directory via VBA

M

Marco

How can I get the username of the current logged in user in VBA for Word?

greetings Marco
 
J

JE McGimpsey

Marco said:
How can I get the username of the current logged in user in VBA for Word?

one way:

sUserName = MacScript("(user name as string)")

Note, you can also use

sUserName = Application.UserName

but that gets the name from the "Me" entry in the Office Address book,
which isn't guaranteed to be the log-in name.
 
M

Marco

I did not know that it was possible to call Applescript from within VBA!

This opens a whole new world for me :)

Thanks very much!
gr. Marco
 

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

Top