Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-07-2019, 04:08 AM
Visor Visor is offline Disable cut, copy and paste Windows 10 Disable cut, copy and paste Office 2013
Advanced Beginner
Disable cut, copy and paste
 
Join Date: Aug 2019
Posts: 38
Visor is on a distinguished road
Default Disable cut, copy and paste


Greetings friends of the forum, I would like to know how to achieve that in a custom Word file that I deliver to my student, he cannot cut, copy or paste, not Ctrl + x, Ctrl + C, Ctrl + V. I want it that way to make the student write for himself the homework he sends.
I have a code that doesn't work for me but I know there must be some way.

HTML Code:
Private Sub Workbook_Activate()
Dim oCtrl As Office.CommandBarControl
'Deshabilita Cut del todo el menu
     For Each oCtrl In Application.CommandBars.FindControls(ID:=21)
            oCtrl.Enabled = False
     Next oCtrl
'Deshabilita Copy del todo el menu
     For Each oCtrl In Application.CommandBars.FindControls(ID:=19)
            oCtrl.Enabled = False
     Next oCtrl
'Deshabilita Paste del todo el menu
     For Each oCtrl In Application.CommandBars.FindControls(ID:=6002)
            oCtrl.Enabled = False
     Next oCtrl
     Application.CellDragAndDrop = False
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    With Application
        .CellDragAndDrop = False
        .CutCopyMode = False 'Clear clipboard
    End With
End Sub
I come to you to ask for collaboration with this topic.
I appreciate your support in advance
Reply With Quote
  #2  
Old 08-07-2019, 04:42 AM
gmayor's Avatar
gmayor gmayor is offline Disable cut, copy and paste Windows 10 Disable cut, copy and paste Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

What you ask is impossible. ANYTHING that you allow someone to see or hear can be copied. I recall seeing some fake traveller's cheques that had been produced on an Apple Mac back in the 90s that were such good copies the bank had difficulty identifying them. Your document would be child's play by comparison.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 08-07-2019, 06:29 PM
Visor Visor is offline Disable cut, copy and paste Windows 10 Disable cut, copy and paste Office 2013
Advanced Beginner
Disable cut, copy and paste
 
Join Date: Aug 2019
Posts: 38
Visor is on a distinguished road
Default

Greetings, Thank you, I really expected the macro to exist because in reality, the point is not if it will strictly serve the purpose but rather how it can be achieved with macros that are disabled. Indeed for every expert that would be an intention of children. But the file will not be provided to an expert but rather to those who only know how to write in word, but they also have the habit of easily copying, cutting and pasting from another source instead of writing by themselves with their own knowledge These are students who are not from the Informatics Degree. If they were to solve that they can be copied from other sources, at least it will cost them to consult an expert to solve the problem. I have managed to do this in Excel but not in Word. So for this reason I go to the experts of a forum in which we only share among those who know more and know little, ... the others, that is to say those who have not even heard of VBA surely do not enter these sites.
That is why I will continue to wait to see if anyone else has any proposal to demonstrate and collaborate
Reply With Quote
  #4  
Old 08-07-2019, 09:08 PM
Guessed's Avatar
Guessed Guessed is offline Disable cut, copy and paste Windows 10 Disable cut, copy and paste Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

A macro solution is easily circumvented by disabling macros - which is the default for any file obtained from email or a website. They don't have to be a genius to avoid your restriction.

Perhaps you could lock an entire document and only enable editing via a userform. This at least forces regular users into running macros.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #5  
Old 08-08-2019, 12:12 AM
gmayor's Avatar
gmayor gmayor is offline Disable cut, copy and paste Windows 10 Disable cut, copy and paste Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The attached might work for you. It works on the premise of having a first section that contains a warning and the rest of the document is hidden. If macros are enabled copy and paste are inhibited and the hidden text is exposed and the first section hidden.

It is not foolproof, but it should fox a few who are not familiar with hidden text and macros. I have not protected the code but you should - again that's not foolproof, but it may help.

Don't underestimate the ability of people to circumvent such measures.
Attached Files
File Type: docm CopyPasteInhibited.docm (23.1 KB, 54 views)
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #6  
Old 08-08-2019, 07:31 PM
Visor Visor is offline Disable cut, copy and paste Windows 10 Disable cut, copy and paste Office 2013
Advanced Beginner
Disable cut, copy and paste
 
Join Date: Aug 2019
Posts: 38
Visor is on a distinguished road
Default

Guessed
"They don't have to be a genius to avoid your restriction."

Thank you, effectively I do not try to underestimate the intelligence of anyone, but it is also real in that there are many people who do not realize the solution that is in front, of course, a simple not to accept the macro would already be the solution. I will see how this idea is walked.
The solution that gmayor gently offers me is interesting in the face of this dilemma, as far as Vba is concerned and for many who understand this code simply by entering and commenting on it or deleting it so that this instruction is eliminated. Of course. Placing a code is another step of difficulty for the neophytes.
Now, the vba coding of gmayor is not so easy for me to understand . For example, I don't see where it blocks the Copy instruction, however, we have
Sub EditCopy (): Exit Sub: End Sub
EditCopy is just the name of the macro and Exit sub disables something but how does it relate to Copy? ...
It worked well to avoid copy, paste, ...

But I lacked for the Cut instruction because if it allows me to cut and paste in another document.
Could you please complete me or tell me to avoid cutting ???

I know that something is going to help, I don't know how long, but my students will have nothing left but to write in the document what they discern for themselves for the written explanation.

Thank you gmayor
Reply With Quote
  #7  
Old 08-08-2019, 07:56 PM
Visor Visor is offline Disable cut, copy and paste Windows 10 Disable cut, copy and paste Office 2013
Advanced Beginner
Disable cut, copy and paste
 
Join Date: Aug 2019
Posts: 38
Visor is on a distinguished road
Default

In addition, I have just discovered that using the special paste is able to bring text from other documents, therefore this in necessary also disable it, because without doing anything special the problem is already solved . I would like this to be blocked too
Cut
Special paste

I thank you very much for your help
Attached Images
File Type: png pegados especiales.PNG (5.8 KB, 53 views)
File Type: png REPROBADO.png (34.6 KB, 52 views)
Reply With Quote
  #8  
Old 08-08-2019, 08:00 PM
gmayor's Avatar
gmayor gmayor is offline Disable cut, copy and paste Windows 10 Disable cut, copy and paste Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

EditCopy, EditPaste etc intercept those built-in commands. To prevent cutting create another similar macro called EditCut. For Paste Special EditPasteSpecial
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #9  
Old 08-08-2019, 10:35 PM
Visor Visor is offline Disable cut, copy and paste Windows 10 Disable cut, copy and paste Office 2013
Advanced Beginner
Disable cut, copy and paste
 
Join Date: Aug 2019
Posts: 38
Visor is on a distinguished road
Default

Thanks, gmayor,
its seems magical by simply placing...
Sub EditCut ()
Exit Sub
End Sub
cut disable function worked

But this code:

Sub EditPasteSpecial ()
Exit Sub
End Sub

It did not work, if I copy or cut another document, the special paste works, which I would not want because it is required to also be disabled.
Reply With Quote
  #10  
Old 08-08-2019, 10:47 PM
gmayor's Avatar
gmayor gmayor is offline Disable cut, copy and paste Windows 10 Disable cut, copy and paste Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

It works here. Add another line e.g.

Code:
Sub EditPasteSpecial()
    MsgBox "Pasting is not allowed"
    Exit Sub
End Sub
Do you get the message box when you select paste special?
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #11  
Old 08-09-2019, 04:15 AM
Visor Visor is offline Disable cut, copy and paste Windows 10 Disable cut, copy and paste Office 2013
Advanced Beginner
Disable cut, copy and paste
 
Join Date: Aug 2019
Posts: 38
Visor is on a distinguished road
Default

Not,...
EditPasteSpecial
it does not work
Reply With Quote
  #12  
Old 08-09-2019, 12:44 PM
Visor Visor is offline Disable cut, copy and paste Windows 10 Disable cut, copy and paste Office 2013
Advanced Beginner
Disable cut, copy and paste
 
Join Date: Aug 2019
Posts: 38
Visor is on a distinguished road
Default

Regards, gmayor,
Trying to find a solution for EditPasteSpecial, I found this:

Apparently I have not been the only one who has seen this need or you to the first to help you on this issue.
I found this link:
https://groups.google.com/forum/#!to...al/8DuqbGS4aqw
Reply With Quote
  #13  
Old 08-12-2019, 07:40 AM
Visor Visor is offline Disable cut, copy and paste Windows 10 Disable cut, copy and paste Office 2013
Advanced Beginner
Disable cut, copy and paste
 
Join Date: Aug 2019
Posts: 38
Visor is on a distinguished road
Default

Hi
This code apparently is only for version 2003,

Sub EditPasteSpecial()
If Selection.StartIsActive Then
Selection.Delete
End If
Exit Sub
End Sub

what would it be version since 2013???
Reply With Quote
  #14  
Old 11-27-2022, 09:41 PM
wangch3 wangch3 is offline Disable cut, copy and paste Windows 10 Disable cut, copy and paste Office 2019
Novice
 
Join Date: Nov 2022
Posts: 1
wangch3 is on a distinguished road
Default I'd like to know the solution for Disable cut, copy and paste too in Word Macro

I'd like to know the solution for Disable cut, copy and paste too in Word Macro. Word version: word 2019
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable Paste in specific range il_betto Excel Programming 2 06-12-2019 12:06 AM
Copy and paste AUBuck Excel 1 07-20-2017 12:07 PM
Disable cut, copy and paste When I copy&paste a second copy appears that can't be edited makeo22 Word 3 04-26-2017 07:09 PM
Disable cut, copy and paste Copy / paste BoyertownCasket Excel 4 04-19-2016 12:32 AM
Disable cut, copy and paste Paste Special: Copy and Paste Formatting Only? tinfanide Word 6 03-06-2013 12:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:52 PM.


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