Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-28-2020, 09:32 AM
b.nels092 b.nels092 is offline Command Button Grabs and Inserts Current User Information Windows 10 Command Button Grabs and Inserts Current User Information Office 2016
Novice
Command Button Grabs and Inserts Current User Information
 
Join Date: Apr 2020
Location: Madison, WI
Posts: 2
b.nels092 is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 04-28-2020, 06:11 PM
Guessed's Avatar
Guessed Guessed is offline Command Button Grabs and Inserts Current User Information Windows 10 Command Button Grabs and Inserts Current User Information Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,975
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
To make a macrobutton field which will run the above macro you type the following text, select it and press Ctrl-F9 then press F9
Macrobutton ApproveIt Double Click this text to approve the document!
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 04-29-2020, 08:51 AM
b.nels092 b.nels092 is offline Command Button Grabs and Inserts Current User Information Windows 10 Command Button Grabs and Inserts Current User Information Office 2016
Novice
Command Button Grabs and Inserts Current User Information
 
Join Date: Apr 2020
Location: Madison, WI
Posts: 2
b.nels092 is on a distinguished road
Default

That was exactly what was needed! Thank you very much! We decided the email wasn't important. I greatly appreciate your help!
Reply With Quote
Reply

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

Other Forums: Access Forums

All times are GMT -7. The time now is 10:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft