Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 09-20-2019, 07:38 AM
gmaxey gmaxey is offline Button with VBA to attach a file in a protected document Windows 10 Button with VBA to attach a file in a protected document Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

So you image doesn't show:

Code:
Sub Prot(strPW As String)   'A basic Word macro coded by Greg Maxey   ActiveDocument.Protect wdAllowOnlyFormFields, True, strPW End Sub Sub UnProt(strPW As String)   'A basic Word macro coded by Greg Maxey   If ActiveDocument.ProtectionType <> wdNoProtection Then     ActiveDocument.Unprotect strPW   End If End Sub

Where did you put them?  Put them in your userform module with the command button code.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to create a button to attach the active word doc to an email as a PDF without using Outlook TAKMalcolm Word VBA 1 09-21-2017 01:52 AM
Button with VBA to attach a file in a protected document How do I attach a ribbon button to a particular template in Word 2010? HelenT Word VBA 1 10-07-2015 03:32 AM
File Not Found error when trying to attach Word document to email Kimber Word 0 03-06-2015 06:47 PM
Button with VBA to attach a file in a protected document Command Button will not work when document is protected brockjensen Word 1 11-02-2012 06:59 PM
Debug for macro run through button only when sheet protected leahca Excel Programming 0 11-24-2011 04:47 AM

Other Forums: Access Forums

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