UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

> Autokeys For Text Output?, Office 2010    
 
   
ScooterBruce
post Mar 28 2012, 10:07 PM
Post #1

UtterAccess Addict
Posts: 293
From: Utah



I know that by pressing Ctrl + ; will insert the current date and Ctrl + Shift + ; will insert the current time, but I need something a little more custom.

I would like to have a shortcut key that will insert the results of
CODE
Now() & " " & fOSUsername() & ": "


I was thinking I might be able to use an Autokeys macro entry, but I am not seeing how to do that.

Go to the top of the page
 
+
 
Start new topic
Replies (1 - 1)
arnelgp
post Mar 29 2012, 01:22 AM
Post #2

UtterAccess Ruler
Posts: 1,090



This is an alternative though.
You can accomplish same functionality as Autokey on the KeyUp Event of the control.
CODE
Private Sub TextBox0_KeyUp(KeyCode As Integer, Shift As Integer)
       Dim strDummy As String
       ' If the user pressed Ctrl then (Shift value of 2)
       ' together with ";" (keyCode value of 186)
       ' then remove the default value that this key generate
       ' and insert Now() + my name
       If KeyCode = 186 And Shift = 2 Then
                 Me.TextBox0.Undo
                 strDummy = Now() & " Arnel GP :"
                 Me.TextBox0 = strDummy
       End If
End Sub
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 18th June 2013 - 12:53 AM