#1
|
|||
|
|||
Use macro on form activate attached to read only file
Hi All,
I'm from the Netherlands. I have a word docm file. I have set it's property to read only with windows explorer. When I open the file with Word 2016 it is by protected for editing wich I understand based on my setting in windows explorer. If done this to prevent the file for overwriting by a user when they press Ctrl+S. What I what is to run a macro attached to a form which I show when the document is activated to enable editing. Now I have to do this by hand (see attachment, click "Beeld", click "Document bewerken". I can't find how to activate the command bar (Beeld) at the top and select the option to enable editing (Document bewerken). See the attachment. It's in Ducth Hopefully someone can help me. Thnxs to you all! |
#2
|
|||
|
|||
The first thing you need to do is use the record feature to record the steps that you want your macro to take. Once you have that, create a userform with a couple buttons to put that code with.
Lastly, once you have the userform created, create a new sub called AutoOpen(). In that sub put "Userform1.Show" (or whatever your userforms name is). Whenever that document is opened, that userform will initiate. |
#3
|
||||
|
||||
A macro can't change the Windows Explorer read-only attribute of an opened file. If you don't want users to edit the files, you should use Word's own read-only recommended option (see under Save As>Tools>General). Alternatively - and perhaps preferably in this case - save the document as a Word Template, which means the users will actually be creating a new document each time they double-click on the file.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
hmm...solved
Hi macropod/dwirony.
The solution mentioned by macropod seems to be working just fine for me. I was thinking much to complicated reading you're answer. Great to use a forum like this where people look at different approach to something. Thanks for you're help!! I'm going to implement it in "production". When something is occuring I will be back! Greets! |
Tags |
macro, office 2016, vba |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
as to activate a macro without operator input ? | gianca53 | Excel Programming | 0 | 02-02-2017 09:09 AM |
Was hoping to use a Macro on the attached form, but... | brians34 | Word VBA | 3 | 09-15-2015 11:56 AM |
Macro to read text file and organize data in excel | srinidhi.mv88 | Excel Programming | 5 | 05-19-2015 12:06 AM |
macro used to activate shortcut keys | hudsontucker13 | PowerPoint | 1 | 12-14-2013 09:47 AM |
Run Macro & Activate shape | ibrahimaa | Excel Programming | 1 | 01-21-2012 02:14 AM |