Reply
 
Thread Tools Display Modes
  #1   Report Post  
WordNoob WordNoob is offline
Junior Member
 
Posts: 0
Default Help with Drop Down Macro to select Document Background Color

So I am trying to create and office memo template and as part of this based on what the memo is for, the user of the form selects the purpose and it changes the background color of the document.

So I created a Drop-Down List Content Control Named "BackgroundColor" with the Values "Blue" and "Green" for 2 different purposes.

I then wrote a VBA Macro as follows

Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
ActiveDocument.Unprotect
With ActiveDocument
Select Case ActiveDocument.ContentControls("BackgroundColor")
Case "Blue"
ActiveDocument.ActiveWindow.View.DisplayBackground s = True
ActiveDocument.Background.Fill.ForeColor.RGB = RGB(200, 200, 200)
ActiveDocument.Background.Fill.Transparency = 0#
ActiveDocument.Background.Fill.PresetTextured msoTextureParchment
Case "Green"
ActiveDocument.ActiveWindow.View.DisplayBackground s = True
ActiveDocument.Background.Fill.ForeColor.RGB = RGB(100, 100, 100)
ActiveDocument.Background.Fill.Transparency = 0#
ActiveDocument.Background.Fill.PresetTextured msoTextureParchment
Case Else
End Select
ActiveDocument.Protect wdAllowOnlyFormFields, True
End With
End Sub

The Macro fails with Invalid Parameter. Anyone have any idea how to fix it?

I am on Office Professional Plus 2016

Last edited by WordNoob : August 20th 18 at 04:58 PM
  #2   Report Post  
johnlennon johnlennon is offline
Junior Member
 
Posts: 0
Default

Instagram is among a breed of smartphone apps which have tapped into the creative, image-based online life of young people. Click Instagram video downloader free.
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
document map background color (W 2003) JPh12 Microsoft Word Help 0 October 29th 10 06:35 PM
color background in a document Jacqueline[_2_] Page Layout 1 October 3rd 09 11:55 AM
The background color won't print with my document. T Maddux Microsoft Word Help 1 August 25th 08 10:39 PM
background color for text document Terrie New Users 1 June 18th 07 04:44 PM
Background color on only one page of a document Paul P Microsoft Word Help 1 April 20th 07 05:30 PM


All times are GMT +1. The time now is 06:10 PM.

Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright 2004-2023 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"