#1
|
|||
|
|||
Macro to protect document leaves brackets where the cursor is
Hello,
I have a issue that I just cannot find an answer to. I have some macros set up to protect a document in track changes and to protect a document for filling in forms. I activate the macro using a keyboard combination. The macros work fine, but wherever my cursor is when I hit the keyboard combination it leave a gray bar, or brackets if you type anything. Here is the code that I am using: Sub Fillable () ' 'Fillable Macro ' Selection.Editors.Add wdEditorEveryone ActiveDocument.Protect Password:="", Type:=_ wdAllowOnlyFormFields End Sub Any help would be greatly appreciated. |
#2
|
||||
|
||||
I suspect what you're seeing is nothing more than formfield bookmark boundaries. You can toggle their display on/off via File|Options|Advanced>Show document content>Show bookmarks.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thank you for the reply, but that doesn't seem to be it. I checked that setting and show bookmarks is not checked. I think it has something to do with creating an editable area, but I don't know for sure.
|
#4
|
||||
|
||||
Without actually seeing the problem document, it can be difficult for anyone to diagnose the issue. Can you attach a document to a post with some representative data (delete anything sensitive)? You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
OK, thanks. This is a problem I am having at work so when I get in to the office tomorrow I will attach a document. I really appreciate the help.
|
#6
|
|||
|
|||
I have attached a test document so you can see what is happening. I have three macros setup that run with keyboard combinations. They are:
Ctrl + u unprotects the document when it is protected Ctrl + l protects the document with track changes Ctrl + k protects the document with just being able to fill in forms. The unprotect one works fine. The other two work, but wherever the cursor is when you hit the keyboard combination it leaves that bar. The bar does not show up when printed the doc is printed, however it does show up when I convert the doc to a PDF which I have to do sometimes. The only way to get rid of the bar is to put my cursor on it and type something and then highlight it and delete it. If I just manually go in and protect the documents by typing in the password that bar does not show up. But I don't want to type that password 100+ times a day. Thanks for the help. |
#7
|
||||
|
||||
As I suspected:
Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#8
|
|||
|
|||
Did that work for you on the document that I uploaded, because it doesn't work for me. We are pretty locked down at my office so maybe our IT department is locking something down that is causing this The moment I hit the keyboard combination as posted, that bar shows up. Is there something I can put in the VBA code to stop that bar from showing up? I will try again, but whenever I go into that setting the show bookmarks is not checked. This never used to happen, but that was probably with an older version of Word.
|
#9
|
||||
|
||||
Quote:
Quote:
ActiveWindow.View.ShowBookmarks = False but, if that works, so too would unchecking the 'Show bookmarks' option. Word has had that setting for at least two decades.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#10
|
|||
|
|||
I will experiment with the toggle and that VBA code some. Thanks for the help, it is greatly appreciated. It seems like this started happening when we switched to Office 10 and I had to redo the macro. I don't really know what I am doing with the macros and VBA so I'm sure I just did something slightly differently when I set up the macros this time. Again, thanks for the help.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
find and delet all text within brackets and the brackets themselves | wrdy | Word | 2 | 08-03-2017 06:55 PM |
editable and protect document | soninha | Word | 1 | 03-30-2015 12:20 PM |
Brackets around entire contents of document | Susan Carol | Word | 5 | 02-01-2015 08:55 PM |
Password Protect a Macro | Mark212 | Word VBA | 2 | 01-14-2015 02:30 PM |
Why does Word 2007 open my document with {SEQ ...} brackets? | Ferenc Nagy | Word | 4 | 02-28-2013 11:20 AM |