Compile error in hidden module

S

Simon

[Apologies if this is a duplicate, I couldn't find my original post anywhere!]

I'm getting this error from the following line of VBA (coded in Office 2003)
when used in Word XP:-
ActiveWindow.View.ShadeEditableRanges = False
Is there any way to get Office XP and earlier versions to ignore the VAB
they don't support?

Maybe there is a better way to achieve what I need....I have to protect an
image (company logo) in a word template from deletion by users. To do this, I
followed advice from a post here. I protected the whole document then
selected everything but the logo and added this as an exception range,
editable by everyone. However, when I create a document, the editable range
is highlighted and this looks terrible since the document is mostly made up
of text over background colors. So I came up with the ablve statement to turn
highlighting off and put it in the Document_Open() event. Now it appears that
this property is not supported in earlier versions. I realize that the
protection isn't going to work in earlier versions but I would like the
macros to work without having specific versions for each version of Office.
Most users are already at, or soon will be migrating to Office XP.

Thanks for any advice on how to make this work!
 
H

Howard Kaikow

Simon said:
[Apologies if this is a duplicate, I couldn't find my original post
anywhere!]


You posted in microsoft.public.office.developer.vba, and I partially
responded there.
 
C

Chuck

Well here's a suggestion - not sure it's the best solution but it'll be
backwards compatible.

Put your logo image anchor in its own section (with continuous section
breaks before and after) or put a continuous section break at the beginning
of your document if the logo is in the header. Protect the document for
Forms and specify that section only. Users will be able to edit anywhere but
that section as well as headers/footers, endnotes and footnotes (if they're
automatically protected in 2003).

You might need to fiddle with this idea but hopefully its a pointer in the
right direction...
 
S

Simon

Chuck said:
Well here's a suggestion - not sure it's the best solution but it'll be
backwards compatible.

Put your logo image anchor in its own section (with continuous section
breaks before and after) or put a continuous section break at the beginning
of your document if the logo is in the header. Protect the document for
Forms and specify that section only. Users will be able to edit anywhere but
that section as well as headers/footers, endnotes and footnotes (if they're
automatically protected in 2003).
Thanks for the suggestion Chuck. Unfortunately Word still highlights the
editable areas but worse, the ability to remove the higlighting has vanished!
The checkbox in the "Protect Document" task pane is no loner there and the
VBA code to remove the hilighting no longer works!

This is truly maddening!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top