Consulting

Results 1 to 4 of 4

Thread: Force Enable Macros in Word 2013+ or Workarounds

  1. #1
    VBAX Newbie
    Joined
    Jul 2019
    Posts
    2
    Location

    Post Force Enable Macros in Word 2013+ or Workarounds

    Hello,

    I have been trying to find some VBA code (I am not a computer expert) that can allow me to force users to enable macros. Now, after researching, I know that it is not completely possible because it would make 'security' become useless. I also found codes for excel that hide the worksheets till macro is enabled or a password is used.

    I also found a thread here but the document with the code is not available and only a hybrid version of it is still there (it was in 2007, and I believe Microsoft might have also made many changes) which is not of use to me.

    Now, from this I know it is possible to create a VBA code such that it restricts editing/printing if the macros are disabled and a pop-up is displayed that asks the user to enable macro's for full access. Can someone help me get this code and also tell me how to implement it.

    The reason why I am doing this is because I want to prevent copy-paste in the document but allow editing of it and also allowing copying and sharing of the document (as a file). The users are not tech experts but if they want to copy paste the document then I want to make it hard for them. I have also already used the 'restrict editing' thing to prevent editing of a few lines in the document. I have used the following codes but it requires enabling macros:

    Sub EditCopy()
    MsgBox "Copy is disabled."
    End Sub


    Sub EditCut()
    MsgBox "Cut is disabled."
    End Sub


    Sub EditPaste()
    MsgBox "Paste is disabled."
    End Sub


    Sub EditPasteSpecial()
    MsgBox "Paste Special is disabled."
    End Sub

    Any solution is welcome. Thank you.

  2. #2
    Quote Originally Posted by Rukuto View Post
    Hello,

    I have been trying to find some VBA code (I am not a computer expert) that can allow me to force users to enable macros.
    It is not possible at all to force users to enable or run macros.
    ANY document that you allow someone to see can be copied. You can only make things a little more difficult.
    Perhaps something like the attached, however it is by no means foolproof.
    Attached Files Attached Files
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  3. #3
    VBAX Newbie
    Joined
    Jul 2019
    Posts
    2
    Location
    Quote Originally Posted by gmayor View Post
    It is not possible at all to force users to enable or run macros.
    ANY document that you allow someone to see can be copied. You can only make things a little more difficult.
    Perhaps something like the attached, however it is by no means foolproof.
    That type of file is exactly what I am looking for. Can you please break it down so I know how to use it. Thank you. How do I get the blank page first and how do I edit what is written on it? Thank you.

  4. #4
    The document example starts with a section new page break with the text you can see on the first page in the first section, the rest of the document is formatted as hidden. The document is protected as read only with a password. When the document is opened, if the macro is allowed to run, the first section is deleted, the document is unprotected and the hidden font attribute is removed.
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •