Substitute for Blue background, white text in Word 2010

jmt356
SilverLounger
Posts: 2371
Joined: 28 Mar 2010, 01:49

Re: Substitute for Blue background, white text in Word 2010

Post by jmt356 »

The issue is not with respect to creating a new module. Rather, it is that all of my modules are gone and I don’t know what happened to them. The last time I checked, I remember a Modules folder in the Visual Basic left-hand-side tree view, and it had 6 modules in it. Now they are all gone.
Regards,

JMT

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Substitute for Blue background, white text in Word 2010

Post by Rudi »

Is the tree view not possibly collapsed? Try double clicking Normal to expose the module folders?
Another possibility is that you did not save the Normal Template when you exited Word. If you change the Normal Temp and close Word it will prompt you to save the current open doc, and then it will prompt a second time asking if you want to save changes to the Normal template. Maybe you dismissed the warning without choosing Yes??
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Substitute for Blue background, white text in Word 2010

Post by HansV »

By default, Word will *not* prompt to save Normal.dotm but save it automatically if it has changed. To have Word prompt, you need to tick a check box in File | Options, category Advanced, section Save:
S0141.png
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Substitute for Blue background, white text in Word 2010

Post by Rudi »

Mine was set to prompt. I didn't realize that the default setting was that it does not prompt? Anyways, it was just another thought that occurred to provide JMT with troubleshooting options...
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

jmt356
SilverLounger
Posts: 2371
Joined: 28 Mar 2010, 01:49

Re: Substitute for Blue background, white text in Word 2010

Post by jmt356 »

I believe there used to be a Modules subfolder under Normal. Per the below screenshot, there is no longer such a folder. It seems I have lost all 6 (?) of my Modules. I don’t think it is hidden because there is nothing for me to expand. I also think that whatever issue I am facing is related to the "Sub or folder not defined” error message I was getting before.

Word did crash earlier today, but upon reloading, I instructed Word to keep my changes to the Normal template.
You do not have the required permissions to view the files attached to this post.
Regards,

JMT

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Substitute for Blue background, white text in Word 2010

Post by HansV »

Your screenshot shows that the modules have indeed been lost. I have no idea why you have so many problems with Word.
I'd create a module, copy the code that you need into it, then save the Normal template - you can use the Save button on the toolbar in the Visual Basic Editor for this purpose. Then quit Word and immediately make a backup copy of Normal.dotm. If you lose the macros again, you can restore the backup copy.
Best wishes,
Hans

jmt356
SilverLounger
Posts: 2371
Joined: 28 Mar 2010, 01:49

Re: Substitute for Blue background, white text in Word 2010

Post by jmt356 »

I believe the error that I reported in the earlier post was due to Word crashing. The computer may have been confused as I had several large files open based on different templates and was performing a heavy operation. Perhaps Word was unable to handle the operation and reacted by deleted my macros. I was able to restore a copy of Normal.dotm from last week's backup and get things back in order though.
Regards,

JMT

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Substitute for Blue background, white text in Word 2010

Post by HansV »

I'm glad you were able to restore Normal.dotm. If you added/modified macros after restoring, I'd create a new backup, to be on the safe side.
Best wishes,
Hans

jmt356
SilverLounger
Posts: 2371
Joined: 28 Mar 2010, 01:49

Re: Substitute for Blue background, white text in Word 2010

Post by jmt356 »

The AutoNew macro causes all of my documents to open with a blue background. Is there a way to disable that macro for certain documents? I have already tried to toggle off the blue background, but even then, when I reopen the document, it comes up with a blue background.

I have considered deleting AutoNew as a macro in the document in which I am trying to disable blue background, but then I think I may inadvertently remove it from Normal.dot, which is not what I want to do.
Regards,

JMT

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Substitute for Blue background, white text in Word 2010

Post by Rudi »

If you are opening existing documents, then its not AutoNew that is making the doc blue, but rather AutoOpen, which triggers when you open an existing document. AutoNew only triggers when you create a new "blank" document.

To avoid the macro changing the background, one can add a prompt to allow you to choose if the background must change.

Something like this:

Code: Select all

Sub AutoNew()
   Dim myR As Integer
   myR = MsgBox("Change BG to blue?", vbYesNo + vbQuestion)
   If myR = vbYes Then
      ActiveDocument.Background.Fill.ForeColor.RGB = RGB(0, 51, 102)
      ActiveDocument.Background.Fill.Visible = msoTrue
      ActiveDocument.Background.Fill.Solid
      ActiveDocument.ActiveWindow.View.DisplayBackgrounds = True
   End If
End Sub

Sub AutoOpen()
   Dim myR As Integer
   myR = MsgBox("Change BG to blue?", vbYesNo + vbQuestion)
   If myR = vbYes Then
      ActiveDocument.Background.Fill.ForeColor.RGB = RGB(0, 51, 102)
      ActiveDocument.Background.Fill.Visible = msoTrue
      ActiveDocument.Background.Fill.Solid
      ActiveDocument.ActiveWindow.View.DisplayBackgrounds = True
   End If
End Sub
However, this might become frustrating to respond to each time a doc is created or opened. If this is the case, you will need to think of a specific condition that can be evaluated by the macro and change the background if that condition is met.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
Jay Freedman
Microsoft MVP
Posts: 1313
Joined: 24 May 2013, 15:33
Location: Warminster, PA

Re: Substitute for Blue background, white text in Word 2010

Post by Jay Freedman »

jmt356 wrote:Is there a way to disable that macro for certain documents?
If you hold down the Shift key while opening a document, either by double-clicking a shortcut to the document or by using the File > Open dialog, that will prevent the Auto macro from running.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Substitute for Blue background, white text in Word 2010

Post by Rudi »

Jay Freedman wrote:If you hold down the Shift key while opening a document, either by double-clicking a shortcut to the document or by using the File > Open dialog, that will prevent the Auto macro from running.
Forgot about that one :thumbup:
I use this option often with Access, to prevent Splash screens,Startup forms and Access hiding the nav. pane. Skipped my mind that it can be used in Word too.
Cheers
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

jmt356
SilverLounger
Posts: 2371
Joined: 28 Mar 2010, 01:49

Re: Substitute for Blue background, white text in Word 2010

Post by jmt356 »

Is it possible to apply the AutoNew and AutoOpen macros to only certain templates such that documents linked to different templates do not open up with blue backgrounds?

If I delete AutoNew and AutoOpen by going to Tools | Macros while I am in my document, will it only delete them for my particular document or for all of the documents that are linked to the template?
Regards,

JMT

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Substitute for Blue background, white text in Word 2010

Post by HansV »

If you want the macros to run only in documents based on specific templates, you should copy the macros into those templates, and remove them from your Normal.dot(m) template.

If you have a template containing the macros, and if you create a document based on that template, the macros are NOT copied into the document. The document calls the macros in the attached template. And if you delete the macros, you delete them from the template, thereby making them unavailable to ALL documents based on that template.
Best wishes,
Hans

mcgowan116
NewLounger
Posts: 2
Joined: 23 Oct 2014, 17:16

Re: Substitute for Blue background, white text in Word 2010

Post by mcgowan116 »

The macro submitted in 2013 works perfectly

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Substitute for Blue background, white text in Word 2010

Post by Rudi »

Welcome to Eileen's Lounge...
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

mcgowan116
NewLounger
Posts: 2
Joined: 23 Oct 2014, 17:16

Re: Substitute for Blue background, white text in Word 2010

Post by mcgowan116 »

Thanks Rudi