×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to get User Info in VB

How to get User Info in VB

How to get User Info in VB

(OP)
Hello

I would like to get the user name that is filled in [Tools/Options/User Info/Name:] in a VB macro.

Do you know what is the command that do this?
I've tried Application.username, but it returns the Windows username. I need the Sollid Edge username.

Thankyou if you can help me!

Bye

RE: How to get User Info in VB

(OP)
I found the answer to my own question:

I discovered that this informations are saved in the Windows Registry, so I`m getting this key value with Visual Basic functions.
This solution has a problem, because I`ve to describe the SE version in the key address (Version 17), and it would not run in new verions. So I created a string with the funcion objapp.version, extracting the version string, and it works fine.

By the way, if anyone has a better solution, please tell us.

Thanks

RE: How to get User Info in VB

Hi,

to get the Version the simple way you can use this

Dim sVers as String
sVers = Left(objSeApp.Version, 2)

dy

RE: How to get User Info in VB

Hi,

Oops! Gears not shifted in properly you already described
how to get the version -- read operation failed winky smile

No, I don't think there is a better solution, sometimes
you have to go via the Windows API to obatin som information
because it's only stored there and SE has no direkt method
to retrieve.

dy

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources