Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-01-2017, 12:33 PM
smarti smarti is offline Use macro on form activate attached to read only file Windows 10 Use macro on form activate attached to read only file Office 2016
Novice
Use macro on form activate attached to read only file
 
Join Date: Mar 2017
Posts: 2
smarti is on a distinguished road
Question 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!
Attached Images
File Type: png Naamloos1.png (18.0 KB, 17 views)
Reply With Quote
  #2  
Old 03-01-2017, 03:26 PM
dwirony dwirony is offline Use macro on form activate attached to read only file Windows 7 64bit Use macro on form activate attached to read only file Office 2003
Advanced Beginner
 
Join Date: Oct 2016
Posts: 49
dwirony will become famous soon enough
Default

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.
Reply With Quote
  #3  
Old 03-02-2017, 12:09 AM
macropod's Avatar
macropod macropod is offline Use macro on form activate attached to read only file Windows 7 64bit Use macro on form activate attached to read only file Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #4  
Old 03-02-2017, 09:06 AM
smarti smarti is offline Use macro on form activate attached to read only file Windows 10 Use macro on form activate attached to read only file Office 2016
Novice
Use macro on form activate attached to read only file
 
Join Date: Mar 2017
Posts: 2
smarti is on a distinguished road
Default 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!
Reply With Quote
Reply

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
Use macro on form activate attached to read only file 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

Other Forums: Access Forums

All times are GMT -7. The time now is 05:04 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