Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-29-2014, 08:32 AM
tne22727 tne22727 is offline Restricted editing disables macro Windows 7 64bit Restricted editing disables macro Office 2010 64bit
Novice
Restricted editing disables macro
 
Join Date: Oct 2014
Posts: 1
tne22727 is on a distinguished road
Default Restricted editing disables macro

I created a template with a text field and a form field. I created a macro so the user could hide and unhide the data in the form field however when I restrict editing the macro disappears and says "the requested member of the collection does not exist. Below is the VB. I am also saving as a macro enables template.

Sub MYMACRO()
ActiveDocument.Bookmarks("TextToShow").Range.Font. Hidden = Not ActiveDocument.Bookmarks("TextToShow").Range.Font. Hidden
End Sub
Reply With Quote
  #2  
Old 10-29-2014, 02:01 PM
macropod's Avatar
macropod macropod is offline Restricted editing disables macro Windows 7 64bit Restricted editing disables macro Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Your error message suggests the 'TextToShow' bookmark has been deleted. As for being unable to access the macro via Alt-F8 or Alt-F11 once forms protection is applied, that is normal.

In any event, trying to hide content in a by toggling the font's hidden state is quite unreliable. Whether it actually works depends on how the user has Word configured. Whether the text does hide, or whether it gets printed, is entirely beyond the macro's control. With the font hidden state, there are four possibilities. The hidden text will :
1. neither display nor print
2. display but not print
3. print but not display
4. both display and print
For users who have Word configured to show formatting marks (a quite common setup),'2' is the most likely outcome.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Building Block Gallery Content function on a form with restricted editing wes228 Word VBA 1 08-28-2014 08:14 AM
Specifying a user in restricted editing Ulodesk Word 2 05-24-2014 12:09 PM
Restricted editing disables macro Highlighting from Restricted Editing Invicta Word 3 11-08-2012 06:05 AM
Restricted editing disables macro Restricted Formatting & Editing dani Word 1 11-08-2012 01:09 AM
Restricted editing disables macro Restricted Fonts—but which ones? Phrixos Office 6 02-17-2012 07:39 PM

Other Forums: Access Forums

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