#1
|
|||
|
|||
Command Button Grabs and Inserts Current User Information
Hello all,
I'm looking at adding in a basic command button that reads something like "if you agree with the information above click here." Which will grab the current editor of the file (just User Information in File:Account. Usually just the Name of the editor and their email. Then have the button disappear (if possible?) I'm fairly new to VBA and just don't know how I would even go about finding how to make it navigate and insert the information. |
#2
|
||||
|
||||
When you grab the editor info, where do you want it to go? You could save it as metadata in the document, put it on the page somewhere or even email the info to someone. The editor's name is stored in an application property but their email address might be harder to come by.
Assuming you want to save the approver's name where the button was, the code could look like Code:
Sub ApproveIt() Dim aRng As Range, sApp As String Set aRng = Selection.Range sApp = "Approved by: " & Application.UserName aRng.Text = sApp End Sub Macrobutton ApproveIt Double Click this text to approve the document!
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
That was exactly what was needed! Thank you very much! We decided the email wasn't important. I greatly appreciate your help!
|
Tags |
command button, insert data, user accounts |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Show table list by using chek box command and save document on sharepoint by using command button | Zhibek | Word VBA | 3 | 08-16-2018 06:19 PM |
Default Value in a Cell for User Information | AdiK | Excel | 0 | 11-23-2016 08:14 AM |
Button to duplicate current forms (for an invoice) | krneki | Word VBA | 2 | 06-03-2015 03:59 AM |
Command Button | knp11 | PowerPoint | 2 | 01-18-2015 01:41 PM |
User information | lwnuclear | Outlook | 0 | 09-21-2010 12:03 AM |