macro to close document if macros disabled

I have several users forms that have code to protect the form and alter 
behavior of enter key. When opening security settings request user to enable 
or disable macros. Sometimes new users disables macros this becomes 
problematic since the macros are in place to provide form protection and 
cursor control.

Is there code that would force the document to close if macros are disabled?

Any advice appreciated.
0
Utf
3/18/2010 5:25:01 PM
word.vba.general 1023 articles. 1 followers. Follow

1 Replies
954 Views

Similar Articles

[PageSpeed] 33

No, there is not (and could not be) such code, because it could never run if 
macros are disabled.

The best you can do is to completely disable any editing of the document 
unless the AutoOpen macro is allowed to run and turn off the protection. You 
can also put a big red box at the top of the first page of the document, 
explaining that the user must close the document and reopen it with macros 
enabled; and the AutoOpen macro (if it runs) can hide that box.

-- 
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so 
all may benefit.

cmledbetter wrote:
> I have several users forms that have code to protect the form and
> alter behavior of enter key. When opening security settings request
> user to enable or disable macros. Sometimes new users disables macros
> this becomes problematic since the macros are in place to provide
> form protection and cursor control.
>
> Is there code that would force the document to close if macros are
> disabled?
>
> Any advice appreciated. 


0
Jay
3/18/2010 5:59:40 PM
Reply:

Similar Artilces:

Disableing items in CLIstCtrl
Hello, Is there a way to disable an item in CListCtrl so that the item is gray out and a user won't be able to select it. Thank You! At this point I think you have to go to an owner-draw list control and do it yourself. You also have to prevent the selection from happening. joe On Fri, 15 Apr 2005 11:03:17 -0400, "Ririko Horvath" <horvathr@securemethods.com> wrote: >Hello, > > Is there a way to disable an item in CListCtrl so that the item is gray >out and a user won't be able to select it. > >Thank You! > Joseph M. Newcomer [MVP]...

Switchboard hangs when running a macro
Access 2003: I've recently discovered the Switchboard - a grand concept; wish it wasn't so hidden... When running a macro from a form, no problem. But when running the same macro from the Switchboard, Access hangs. It seems to run all of the steps in the macro, and finish, but then Access hangs. Any help would be appreciated. Thanks, Mike in Sugar Land, TX On Mon, 30 Nov 2009 21:28:03 -0800, Switchboard newbie <Switchboard newbie@discussions.microsoft.com> wrote: My crystal ball is broken. Can you post some code, stripped to the bare essentials? -Tom. ...

Sheet to close
Why won't this work? oldjayo Sub test() Dim wsShtToSave As Worksheet Set wsShtToSave = ActiveSheet If wsShtToSave= "Master" Then ActiveWorkbook.Save ActiveWorkbook.Close End If End Sub Activesheet.name= try this simpler version Sub CloseifMaster() If ActiveSheet.Name = "Master" Then With ActiveWorkbook 'one dot only .Save .Close End With End If End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com "oldjay" <oldjay@discussions.microsoft.com> wrote in message news:...

Trigger Macro on Open Spreadsheet
How can we force a macro to execute whenever a spreadsheet is first opened? Hi do you mean the file? If yes either name your macro Auto_Open() or put your code in the workbook event Workbook_Open() -- Regards Frank Kabel Frankfurt, Germany Beckie Davis wrote: > How can we force a macro to execute whenever a spreadsheet > is first opened? ...

How do I cut closely in 2003
In Pub 2000 you used to be able to press an icon and it would give you loads of points aroung a picture, so you could then cut it and remove backgrounds or if you wanted to no have it so rigid around the edges, I now have Pub 2003 and I cannot seem to get this all I can get it a square crop Can anyone help? Place your cursor anywhere on the edge of the image, click and a new point will automatically be created. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "tessywessy" <tessywessy@discussions.microsoft.com> wro...

Disable recall message on the server
Hi, Is there a way to disable or turn off message recall on the server side? I do not care if it still shows up on the users outlook client, but management would like to make it so it never works on our server. We are using Exch 2003 sp1. Thanks, Debra In news:191B223A-D29E-406E-BE23-D378B9647B2A@microsoft.com, Debra <Debra@discussions.microsoft.com> typed: > Hi, > > Is there a way to disable or turn off message recall on the server > side? I do not care if it still shows up on the users outlook > client, but management would like to make it so it never works on...

Resize a document
Hello, I would like to resize a publisher document 8.5 x 11...to 7 x 9 without disrupting the layout. Any ideas? Hi Tina (anonymous@discussions.microsoft.com), in the Microsoft� newsgroups you posted: || Hello, I would like to resize a publisher document 8.5 x || 11...to 7 x 9 without disrupting the layout. Any ideas? The only options really are to: 1. Create a new publication with the sizes you prefer. 2. Change the page size of your publication, then select all objects on the page, group them, then resize as a group. Items such as text and text in tables will not resize properly. You w...

Lost ability in MSWord to make ANY changes to ANY document
Somehow when I open a document in Word, it will not let me do anything other than open the document, print and close, everything else come up 'faded'- I can't even make changes anymore, and i've tried restoring my system to an earlier date, but nothing- Version of Word? If it's 2007 and someplace on the screen it says something about "This modification is not allowed because selection is locked", it could be that you've been using a trial version that's now expired or you haven't properly activated your full version. -- Cheers! Gor...

Add value when recording a macro
Hello, I recorded a macro to create a bar chart - I checked the checkbox to add the values. Stopped recording and showed me the chart with the values. If I run the macro again, it does not display the value. What is the code I need to always display the value? -- LizW After you create the chart, turn on the macro recorder again Select the chart, and choose Chart>Chart Options On the Data Labels tab, check Values Click OK Turn off the macro recorder In the recorded code, you'll see a line similar to this: ActiveChart.ApplyDataLabels AutoText:=True, LegendKey:=False, _ Ha...

a document has gone in compatibility mode how do I get it back
I lost a couple of documents that I had saved and was changing the saved title and as I have said the document has gone into compatibility and I cant get it back. ...

Macro or VBA
I am dumb, but would like to automatically trim down reports that we get from our IT dept. We have to delete redundant columns (A,B,C,D,E,G,H,J,K)from each report. In other words, the only data we want to view is in F,I,J,P. Can this done more effciently with a macro or VBA/ Could someone give me an example of either so that I could work from and learn? Thank-You start a new workbook open one of those report workbooks record a macro into that new workbook (not the report workbook) when you delete the columns you don't want. stop recording back to that new workbook save it as a nice...

How do you search within a document?
I am woundering how you search with in a saved document. I want to make a spread sheet for my buisness on my supplies, my cost, and my mark up cost but there is over 200 so I was woundering how i can go into this saved document and just type in the item I am looking for and have it pop up with out having to scroll throu the list? The first thing you should look at is Data>Filter. It may well do everything you want. If you need more help, post back. Regards, Fred "Me2020" <Me2020@discussions.microsoft.com> wrote in message news:A6B20D94-EBC2-49E6-9E4F-127...

When printing, how do I keep a letter-sized document from expandi.
I have set up a landscape, letter-sized document in MS Pbulisher. But every time I try and print it, it expands the document to a legal-sized doc. Please help!!! Check your printer settings inside Publisher. -- JoAnn Paules MVP Microsoft [Publisher] "godovino" <godovino@discussions.microsoft.com> wrote in message news:6AEC49BF-CBCA-4F05-932C-034B008D6472@microsoft.com... >I have set up a landscape, letter-sized document in MS Pbulisher. But >every > time I try and print it, it expands the document to a legal-sized doc. > > Please help!!! Could ...

Somehow disabled the ability to click on links in e-mail
A link will show up in an e-mail but when I click on it, nothing happens. Can I correct this? Thanks in advance. --------------= Posted using GrabIt =---------------- ------= Binary Usenet downloading made easy =--------- -= Get GrabIt for free from http://www.shemes.com/ =- Matt <buddyheadx@yahoo.com> wrote: > A link will show up in an e-mail but when I click on it, nothing > happens. Can I correct this? In Internet Explorer, click Tools>Internet Options>Programs>Reset Web Settings -- Brian Tillman ...

Macro #12
Why would a macro behave differently attached to a command button than when event driven through calculate worksheet? What does "behave differently" mean to you? It might help for you to post both a description of what you're concerned about, and relevant parts of your code in a reply message. A couple of things different: Macros in a regular code module may have different default behavior than macros stored in a worksheet code module - for instance Range("A1") in a regular code module is equivalent to ActiveSheet.Range("A1"). In a worksheet module, t...

How to reopen and make changes to a closed contract
I have been reading the blog from ms dynamics team about opening and changing a closed appointment: http://blogs.msdn.com/crm/archive/2007/03/08/how-to-reopen-a-closed-appointment-and-make-changes-to-the-file.aspx I'm trying to do the same thing with a contract. the code I used is almost the same. I changed "Appointment" with "Contract" and the state and state Reason: state code : ' <ContractState>Active</ContractState>'+ state Reason: ' <ContractStatus>3</ContractStatus>'+ see also http://msdn2.microsoft.com/en-us/library/a...

How do I assign a macro I have created to a Command Button in Exc.
I believe on previous versions of excel you right-clicked on the command button and then clicked on assign marco, but this does not seem to appear in the 2003 version of excel. Any help is appreciated. If you add a button from the Forms toolbar, you'll see this option. I think you added a commandbutton from the control toolbox toolbar. Andrew7675 wrote: > > I believe on previous versions of excel you right-clicked on the command > button and then clicked on assign marco, but this does not seem to appear in > the 2003 version of excel. Any help is appreciated. -- D...

Disabled Exchange 2K3 accounts starting to accept new emails #2
Hello, whenever I would disable a user account in Exchange 2003, it would NDR any new email, unless there was a forwarding address in the delivery options tab, which is how I wanted it to be. However, since applying the security updates for February, the disabled accounts have begun accepting new mail. Does anyone have any ideas why? Feb. updates applied: KB890830 KB931978 KB926436 KB924667 KB928843 KB928090 KB918118 KB931836 Hi, you are right, and I think that Microsoft want it to be that way from the beginning. Read this articles http://support.microsoft.com/kb/319047 http://support.m...

Can't open office documents from my emails until word is openned f
When I try to open a word document or excel spreadsheet that is saved as an attachement to an email, I get the message: Windows cannot find ‘c:/users/mona/appdata/local\microsoft\windows\temporary internet files\low\content.IE5\SB2EHHFL\xxx[1].xls\’ Make sure you typed the name correctly, and then try again. If I open Word or Excel before clicking on the attachement to open it, then it works. This problem only happens when using my laptop which is running Windows Vista and office 2007. I do not have any problems with this on our desktop which is running XP and office 2003. Wo...

opening an old 1992 Word document, registry error
I tried to open a document created in 1992 but instead of opening I get a message that tells me I cannot because my registry doesn't allow it -- wrb See “Information about certain file types that are blocked after you install Office 2003 Service Pack 3” at http://support.microsoft.com/?kbid=938810 -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "Seabee74" <Seabee74@discussions.microsoft.com> wrote in message news:6ADC0871-2FB3-4880-9525-5EFE3C3AD3C5@microsoft.com... >I tried to open a document...

move page from one document to another
I need some "fast" help! I have never worked in Publisher before, but need to get a project done for an organization I work for. I need to take several pages from one document and paste them into another document. Both documents are already set up in Publisher. I want to basically "copy" from one document to another. HELP!! kdramirez <kdramirez@discussions.microsoft.com> wrote: >I need to take several pages from one document and paste them into another >document. Both documents are already set up in Publisher. I want to >basically "copy&qu...

Macro #49
Hi guys: I got a question about marco.see below. Adding a new customer to the list whose amount owed should initially be $1500 (the macro should ask you for this value) The macros are to be activated by clicking onto buttons appearing on the debtor2. Thanks. -- SLINKYBOY ------------------------------------------------------------------------ SLINKYBOY's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=27957 View this thread: http://www.excelforum.com/showthread.php?threadid=474580 ...

i cant find my email documents
After installing an antivirus to my xp computer i cannot find all my past email. it gives a socket error number 10060 and an error number of 0x800CCC0E Please help "bAyai" <anonymous@discussions.microsoft.com> wrote in message news:b3e101c4373f$9fc2fd40$a501280a@phx.gbl... > After installing an antivirus to my xp computer i cannot > find all my past email. it gives a socket error number > 10060 and an error number of 0x800CCC0E > Please help If you uninstall it, does the error go away? ...

Disable format painter in excel 2003
The format painter icon keeps appearing when I add or delete columns and rows - it keeps blocking me from seeing what is in the cell and is a general nuisance. I do not need the format painter, but I cant seem to find a way to deactivate it, permanently if possible. Anyone have any ideas? Actually it is probably not the Format Painter, but the Insert Options button that is bothering you. Tools>Options>Edit. Uncheck the Insert Options and for me, also the Paste Options button. Gord Dibben Excel MVP On Mon, 7 Feb 2005 15:43:04 -0800, tenchsama <tenchsama@discussions.microsoft...

Close a process
Hi! I start another applications of my program with ShellExecuteEx and receive its process handle. To watch that they are running no problem, but if the User close my application I want to close the others also. How can I send a WN_QUIT message to its main window? How can I get HWND of its main window from process handle? Thanks for any idea, Imre PostThreadMessage(GetProcessID(hProcess),WM_QUIT,0,0); AliR. "Imre Ament" <ImreAment@discussions.microsoft.com> wrote in message news:0BA0EDAA-F018-4E1C-9A24-5914C2152FDD@microsoft.com... > Hi! > > I start another appl...