VBA to "Copy" text from a field

Leo_Polla_Psemata

Registered User.
Local time
Today, 09:54
Joined
Mar 24, 2014
Messages
364
Hi, I have created a table/form in which i store all of my business app passwords.
I use more than 15 applications, each one requires a password that i must change every 30 or 60 days, different format so, not possible to keep one pass for all.
In the form, i would like to create a button, next to password field, this button i would like, once i click, to copy the password that i will paste in my app.
Do you know which method i must use ?

At this moment, i double click the pass, then right click, copy (or cntr +c) and i paste in the application. Simple but there are several "small" problems.
Today, i made mistake, instead of "cntr+c" i typed "cntr+v" and i pasted the previous text i had on my mouse, i was lucky enouph to spot this out and not save the record.
 
Hi. Check out the RunCommand method.

Code:
DoCmd.RunCommand acCmdCopy
 
Simplest way I have seen is...
Code:
Sub TextToClipboard(Text As String)
    ' this is a late bound MSForms.DataObject
    With CreateObject("New:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
        .SetText Text
        .PutInClipboard
    End With
End Sub
 
If you want some full featured password manager this one works well and is free. I like it much better than other ones I have tried.
Has features to automate filling in web pages and apps with user name and password.
 

Users who are viewing this thread

Back
Top Bottom