Solved

Global detection of active control when text is pasted to a control

Posted on 2002-03-18
5
120 Views
Last Modified: 2010-05-02
There are a set of controls including Text Boxes in a Form.

I am pasting a text onto a Text Box using Mouse/Ctrl+V. Is there any way can the Form Identify in which Control/Text Box the value has been pasted. Can I access the value which has been pasted ?
Is there any API Event or Function through which it can be detected.
0
Comment
Question by:alramanathan
5 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 10 total points
ID: 6876778
Easy if you use the Text1_Change event or similar for each control that you could paste into.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 6876979
If you set the form's KeyPreview property to True, you could use something like this, as an example of the code to implement:


Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If (Shift And vbCtrlMask) Then
        If KeyCode = Asc("V") Or KeyCode = Asc("v") Then
            MsgBox "Text pasted into " & Me.ActiveControl.Name & _
                vbCrLf & vbCrLf & "Text pasted: " & Chr(34) & _
                Clipboard.GetText & Chr(34)
        End If
    End If
End Sub
0
 
LVL 15

Expert Comment

by:ameba
ID: 6877635
alramanathan, please, give FEEDBACK in your other question

http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20276373



0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7634133
Hi alramanathan,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept TimCottee's comment(s) as an answer.

alramanathan, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:kodiakbear
ID: 7665958
Moving to the paq

kb
Experts Exchange Moderator
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now