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
 
Top