Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-19-2009, 04:00 PM
MikeWM MikeWM is offline Textbox & Edit Paste text Windows XP Textbox & Edit Paste text Office 2003
Novice
Textbox & Edit Paste text
 
Join Date: Aug 2009
Posts: 4
MikeWM is on a distinguished road
Angry Textbox & Edit Paste text

Hi,

I have a word (2003) document containing many Activex textboxes which are used to apply a character limit to the users input. Sometimes users want to paste data into the textbox from another source – Ctrl V – works fine, but if they try to do it via the Edit – Paste – menu then the textbox is deleted and replaced with the pasted text.

I tried intercepting the menu option with a selection.paste macro, and also a sendkeys (ctrl v) macro but neither of them worked. Selection.paste still deletes the texbox, and the sendkeys macro allowed paste to work in the textbox but not the rest of the document (other things need to be pasted in the document also). Any ideas?

Many thanks.
Reply With Quote
  #2  
Old 08-20-2009, 06:21 PM
MikeWM MikeWM is offline Textbox & Edit Paste text Windows XP Textbox & Edit Paste text Office 2003
Novice
Textbox & Edit Paste text
 
Join Date: Aug 2009
Posts: 4
MikeWM is on a distinguished road
Smile Found a solution.

Code:
Sub autoopen()
Application.CommandBars("Edit").Controls.Item("Paste").OnAction = "catcher1"
Application.CommandBars("Edit").Controls.Item("Paste Special...").OnAction = "catcher2"
End Sub
Public Sub catcher1()
SendKeys "^{v}"
End Sub
Public Sub catcher2()
MsgBox ("This option has been disabled by the administrator. Please use the shortcut keys 'ctrl+v' to paste.")
End Sub
Reply With Quote
Reply

Tags
activex, inline shapes, textbox

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
PA To the CEO Can't Edit Private Appointments Outlook 2007 Neil Parry Outlook 0 03-29-2009 10:05 PM
How can I edit a form Bushy Word 0 03-17-2009 01:09 PM
Set text in edit control on inspector window indicating time Outlook 2007 saniltalathi Outlook 0 02-20-2009 08:43 AM
Templates: automatic text generation from Rich Text content control Chickenmunga Word 0 10-01-2008 11:16 AM
Textbox & Edit Paste text paste formated text from Word to only one Excel cell heron Word 1 12-06-2005 02:37 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:02 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft