Editing Content Clipboard Before Pasting (Ctrl-V) In VB6 - VbCity
Có thể bạn quan tâm
![]() | The .NET Developer Community |
| Sign in | Join | Help |
- Home
- Blogs
- Forums
- FAQ
- Wikis
- Members
- Search
- Services
rated by 0 users
This post has 2 Replies | 1 Follower
djeek
Reply
rated by 0 users I want to catch Ctrl-v with the KeyDown (and/or KeyPress) event so I can edit de keyboard before the paste. The editing proces is simple: with Clipboard.Gettext to a string variable and then clearing the clipboard followed by Clipboard.Settext the string. All Word- or HTML-**** is gone then! I tried the KeyDown event but running the program pasted the clipboardtext in my code!!!!! The KeyPreview of the form is true.Please help!?Code:Private Sub Form_KeyDown(keycode As Integer, Shift As Integer) Dim CB As String Exit Sub If keycode = 68 And Shift = 2 Then 'Ctrl-V (does not work in a input field in the Webbrowser Control) CB = Clipboard.GetText 'strip codes (Word/html) from clipboardtext via stringvariabele Clipboard.Clear Clipboard.SetText CB 'Put the stripped text back on the clipboard DoEvents SendKeys "^(v)", True 'Continue the paste proces keycode = 0 Shift = 0 End If End Sub - | Post Points: 20
Boma
Reply
rated by 0 users Hi,instead of using Key events you could just set a timer in your form and then clear the Clipboard all the time, no matter what key is pressed.Code:Private Sub Timer1_Timer() CB = Clipboard.GetText Clipboard.Clear Clipboard.SetText CB End SubregardsBoma - | Post Points: 5
djeek
Reply
rated by 0 users Thanks for replying Boma! Low response on this subject... Difficult?!Your solution is not possible because other applications that are running has to use the clipboard too: with those applications I was copying before the paste action with my VB-app! - | Post Points: 5
Từ khóa » Visual Basic Sendkeys Ctrl+v
-
Emulate Copy-paste From Keyboard Wedge Application In
-
Application.SendKeys Method (Excel) - Microsoft Docs
-
SendKeys Statement (VBA) - Microsoft Docs
-
[SOLVED] SendKeys Really Working [Archive] - VBA Express Forum
-
Thread: Send Keys Function Keeps Ctrl V - VBForums
-
Using Sendkeys() Function To Send Keys Like ALT, CTRL, Etc.?
-
How To Use Excel SendKeys Method In Macros - Contextures
-
What Are SendKeys In VBA? - Software Solutions Online
-
VBA !! Copying And Pasting To Another Application - Mr. Excel
-
VB Script That Mimics CTRL+C, CTRL+G, CTRL+V, ENTER? - Bytes
-
Sendkey (Ctrl+C) Problem | MrExcel Message Board
-
Simulate Keyboard Stroke Ctrl+v Using C# Results “v” In ... - CodeProject
-
Use VBA SendKeys To Send Keystrokes Anywhere
-
Visual Basic, How To Simulate Ctrl-V (paste) In Textbox By Code ?
