Diary Notes Date/Time

G

Guy

Hi All,

Just want to set up a ctrl key combination to insert the username and a date
stamp at the current insertion point in the textbox such as:

Fred 4-Jul-08:

Leaving the insertion point at the end of the line ready for the user to
start typing.

Diary notes are generally added to the start of the multiline textbox so
that the most recent note is at the top as in:

Fred 4-Jul-08: Phoned Julie in Operations and arranged a date and time to
pick up the dry cleaning.
Dave 21-Jun-08: Phoned Alice in Accounts to advise them that their account
was 30 days overdue. Alice said payment will be processed in next cheque run
due Wed.

And so on.

No problem achieving the timestamp using either an AutoKey that runs code to
build and insert the text into the current active control (if it is a
textbox) or alternatively using the keypress event on the control itself.

The problem I have is setting the insertion point.

I have tried Sendkeys "{End}" and various other combinations but can't get
it to work. Probably missing something obvious, but can anyway help?

Guy
 
G

Guy

Alex,

Brilliant,

..SelStart = Len(.Text)

Where .Text is the length of the date stamp, works like a charm.

Kind Regards,
Guy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top