Thank you Jean-Guy for your response. Yes, the code I described IS in the
ThisDocument module. However, when the document opens, the .tif graphic is
hidden. Only after the code is compiled manually using the VB Editor does it
behave properly. I did not write the code myself. I have hardly any
experience at all writing macros in Word. All my VB experience has been using
Access. However, my expertise rating is probably only "intermediate" using VB.
To me it seems ambiguous though to have 2 lines with contradicting
definitions:
strVersion = Application.Version
strVersion = Left(strVersion, InStr(strVersion, ".") - 1)
Could that be the problem? Or do you have any other suggestions?
Thanks!
Brady
Brady was telling us:
Brady nous racontait que :
> Thank you Jean-Guy for your response. Yes, the code I described IS in
> the ThisDocument module. However, when the document opens, the .tif
[quoted text clipped - 9 lines]
>
> Could that be the problem? Or do you have any other suggestions?
No, if the macro is in the ThisDocument module, it should run.
strVersion = Application.Version
strVersion = Left(strVersion, InStr(strVersion, ".") - 1)
If you are using Office 2003:
strVersion = 11.0
strVersion = Left(11.0, InStr(11.0, ".") - 1) = 11
This is a fancy way to get the hidden text to true in the following line:
ThisDocument.Sections(1).Headers(wdHeaderFooterPrimary) _
.Range.Paragraphs(1).Range.Font.Hidden = (CLng(strVersion) > 8)
is
ThisDocument.Sections(1).Headers(wdHeaderFooterPrimary) _
.Range.Paragraphs(1).Range.Font.Hidden = (CLng(11) > 8)
is
ThisDocument.Sections(1).Headers(wdHeaderFooterPrimary) _
.Range.Paragraphs(1).Range.Font.Hidden = (11 > 8)
is
ThisDocument.Sections(1).Headers(wdHeaderFooterPrimary) _
.Range.Paragraphs(1).Range.Font.Hidden = True
I do not now why it was written this way... If you are using Word 97, hidden
text will be set to False.
Without more to go on, I cannot say why it isn't working.
Is the code in a template or in a document?
If you put a Stop at the beginning of the code, does the code Stop when you
open a document, or is it totally ignored?

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Brady - 21 Jan 2005 14:47 GMT
Jean-Guy,
Sorry to take so long to get back to you but the Discussion Group site
evidently had some problems yesterday and I was unable to reply.
Your last message solved my problem. Much Thanks! When I ran the Stop, upon
reopening the document a message appeared notifying me that Word's Security
Level was set to High, thus disabling all unsigned macros (like I told you, I
am not very experienced with programming Word). Anyway, I changed the level
and then resaved the document under another name. All went well.
The funny thing is that when I reset Word's Security back to High and
re-opened the document... it still worked. I don't know why, but I am not
complaining.
By the way, just for the record, in answer to your last query, it was a .doc
file, not a template.
Thanks again for all your help!
Brady
> Brady was telling us:
> Brady nous racontait que :
[quoted text clipped - 42 lines]
> If you put a Stop at the beginning of the code, does the code Stop when you
> open a document, or is it totally ignored?