Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-24-2023, 11:58 PM
elaineAda elaineAda is offline How to make users enable macro before opening the file? Windows XP How to make users enable macro before opening the file? Office 2010
Novice
How to make users enable macro before opening the file?
 
Join Date: Mar 2019
Posts: 25
elaineAda is on a distinguished road
Default How to make users enable macro before opening the file?

Hi Hi

Is there a macro that could 'force' users to enable macro before opening the file?



Thanks
Reply With Quote
  #2  
Old 01-25-2023, 10:41 PM
BrianHoard BrianHoard is offline How to make users enable macro before opening the file? Windows 10 How to make users enable macro before opening the file? Office 2019
Advanced Beginner
 
Join Date: Jul 2022
Location: Haymarket, VA USA
Posts: 85
BrianHoard is on a distinguished road
Default

If you're referring to the warning that Office gives when opening a macro-enabled document, like docm or dotm, what we do is place the file in a trusted folder for the user. In our environment, that is in the user's STARTUP folder, at %APPDATA%\Roaming\Microsoft\Word\STARTUP
You can see what locations are trusted on your system by looking in your Trusted Locations. From Word, Options > Trust Center > Trust Center Settings > Trusted Locations

Does that help?
Reply With Quote
  #3  
Old 01-29-2023, 03:00 AM
elaineAda elaineAda is offline How to make users enable macro before opening the file? Windows XP How to make users enable macro before opening the file? Office 2010
Novice
How to make users enable macro before opening the file?
 
Join Date: Mar 2019
Posts: 25
elaineAda is on a distinguished road
Default

Hi BrianHoard
It didnt seem to work.
I have a turn around solution, it is to password protect the file, and user can only edit the file when user click on 'enable content.'
But the macro that i wrote cannot work perfectly.
Error message encountered when user save the file, and then close the file without saving the file. When user exit the file like that, the file was not save and became password unprotected.
When user try to access the file the next round, there is error message.
Is there anyway to go about this?
Attached Files
File Type: docm sample text 1 macro1.docm (27.1 KB, 4 views)
Reply With Quote
  #4  
Old 01-30-2023, 07:07 AM
elaineAda elaineAda is offline How to make users enable macro before opening the file? Windows XP How to make users enable macro before opening the file? Office 2010
Novice
How to make users enable macro before opening the file?
 
Join Date: Mar 2019
Posts: 25
elaineAda is on a distinguished road
Default

Quote:
Originally Posted by elaineAda View Post
Hi BrianHoard
It didnt seem to work.
I have a turn around solution, it is to password protect the file, and user can only edit the file when user click on 'enable content.'
But the macro that i wrote cannot work perfectly.
Error message encountered when user save the file, and then close the file without saving the file. When user exit the file like that, the file was not save and became password unprotected.
When user try to access the file the next round, there is error message.
Is there anyway to go about this?
Basically it is to unprotect a password protected document, then re protect upon closing. Appreciate help on this.
Reply With Quote
  #5  
Old 02-01-2023, 10:25 PM
gmayor's Avatar
gmayor gmayor is offline How to make users enable macro before opening the file? Windows 10 How to make users enable macro before opening the file? Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,137
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 ofgmayor has much to be proud of
Default

If the aim is to allow the user to edit only part of the document, e.g. in your sample to add the name and address, you don't need a macro. You can use content content controls to accept the user input and add editors to the controls before protecting as read only and then the user can only edit the content control contents. See attached (the password is the same as your sample).
The easiest way to do this is to use Insert Content Control Add-In which includes the options to add editors and protect the document. It can be done without, but it is more fiddly to do so.
Attached Files
File Type: docx sample text without macro1.docx (27.0 KB, 4 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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Autorun macro when opening the file Tom cheeseburger PowerPoint 2 07-07-2021 05:42 PM
How to make users enable macro before opening the file? How to automatically enable the macros upon opening a file with macros? laurieli Office 7 01-17-2016 08:56 AM
How to automatically enable macros upon opening the Word? laurieli Word VBA 2 12-22-2015 02:46 PM
How to make users enable macro before opening the file? Automatically make .dotm file available to all users on network donaldadams1951 Word 2 02-26-2014 10:47 PM
How to make users enable macro before opening the file? Prompt a macro to run when opening a specific file type gmanword Word VBA 5 11-30-2013 02:55 PM

Other Forums: Access Forums

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


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft