Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #12  
Old 01-23-2011, 01:15 AM
hansj hansj is offline Form protected in design mode-can't do anything Windows Vista Form protected in design mode-can't do anything Office 2010 32bit
Novice
 
Join Date: Jan 2011
Posts: 1
hansj is on a distinguished road
Default Solution with normal.dotm?

I encountered the same problem with design mode in another context. Every time I opened a document (that contains an AutoOpen procedure), I was told that code could not be executed in design mode.

The following solution worked. Place this procedure in normal.dotm:

Private Sub AutoOpen()

Dim Index As Byte

With ActiveDocument.VBProject
For Index = 1 To .VBComponents.count
With .VBComponents(Index)
If .HasOpenDesigner Then .DesignerWindow.Close
End With
Next
End With

End Sub

"Private" to ensure that there will be no conflict with other "AutoOpen" procedures.

I found this code somewhere on the net. My only contribution is placing it universally functioning in Normal.dotm (and using "Byte" in stead of "Long").

The funny thing is that after having closed and opened Word one or two times I could remove this piece of code from Normal.dotm - and the problem was gone.

Best wishes
HansJ
Reply With Quote
 

Tags
design mode, protected form



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding table lines to protected form razberri Word Tables 2 10-27-2010 05:58 PM
Font size changes in a protected form..? jackbkmp Word VBA 0 03-03-2010 10:14 AM
Editing Password protected form fields in Word 2007 tamilan Word 2 02-16-2010 09:45 AM
Form design question aalytics Word 0 12-04-2009 07:32 PM
protected form with underline fillable spaces rohitsahib Word 0 02-02-2006 10:22 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:19 AM.


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