I have six different styles defined - essentially they are same except for the bullet (picture) is different for each. All other parameters are same.
EDIT: The user can only have one of these styled paragraph defined in the document, i.e. they are mutually exclusive.
Now, within the document the user may use one of these styles. Also, the used style content is also used as part of the header for the document. How, can I set up the header so that only the style used in the document is reflected and other styles *do not* show the error, i.e. if the document is defined with styleblue then all others return an error. My header is defined with styleref for all six different styles as follows:
Thanks.
One of six styles in the heading - Word 2003/2007/2010
-
- 5StarLounger
- Posts: 656
- Joined: 18 Feb 2010, 14:26
One of six styles in the heading - Word 2003/2007/2010
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78625
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: One of six styles in the heading - Word 2003/2007/2010
If the user can use only one of these styles, I'd use a single style PSH, refer to that in a single STYLEREF field, and change the bullet colour as needed.
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 656
- Joined: 18 Feb 2010, 14:26
Re: One of six styles in the heading - Word 2003/2007/2010
Interesting.HansV wrote:If the user can use only one of these styles, I'd use a single style PSH, refer to that in a single STYLEREF field, and change the bullet colour as needed.
Remember the bullets are actually *images* not just differently coloured bullets. Is it actually viable to change the bullet image ' on the go sort of speak'?
-
- Administrator
- Posts: 12629
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: One of six styles in the heading - Word 2003/2007/2010
For each of the styles that you may have in the document you could include
{ IF { STYLEREF "Style name here" } = "Error! No text of specified style in document" "" "{ STYLEREF "Style name here }"
Here is an example from a document of mine that may have a Heading 1 style or may have an Appendix 1 style, and I want this to be include in the header.
{ IF { STYLEREF "Style name here" } = "Error! No text of specified style in document" "" "{ STYLEREF "Style name here }"
Here is an example from a document of mine that may have a Heading 1 style or may have an Appendix 1 style, and I want this to be include in the header.
You do not have the required permissions to view the files attached to this post.
StuartR
-
- Administrator
- Posts: 78625
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: One of six styles in the heading - Word 2003/2007/2010
As far as I can tell, you cannot set the bullet image from an AutoText entry (or Building Block), it has to be from an external file, so that would not be practical.Robie wrote:HansV wrote:Is it actually viable to change the bullet image ' on the go sort of speak'?
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 656
- Joined: 18 Feb 2010, 14:26
Re: One of six styles in the heading - Word 2003/2007/2010
Thanks Stuart.StuartR wrote:For each of the styles that you may have in the document you could include
{ IF { STYLEREF "Style name here" } = "Error! No text of specified style in document" "" "{ STYLEREF "Style name here }"
Here is an example from a document of mine that may have a Heading 1 style or may have an Appendix 1 style, and I want this to be include in the header.
I think that works works for me. Let me try it out.
CHEERS.
-
- Administrator
- Posts: 78625
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: One of six styles in the heading - Word 2003/2007/2010
One thing to keep in mind: if your document will be viewed by users with a non-English version of Word, Stuart's solution won't work. The error messages are language-dependent - if you open the document in the French version of Word, the error message would be "Erreur! Il n'y a pas de texte répondant à ce style dans ce document", so
{ STYLEREF "Style name here" } = "Error! No text of specified style in document"
would not be true.
{ STYLEREF "Style name here" } = "Error! No text of specified style in document"
would not be true.
Best wishes,
Hans
Hans
-
- Administrator
- Posts: 12629
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: One of six styles in the heading - Word 2003/2007/2010
I tried replacing the literal text "Error! No text of specified style in document" with a Styleref for a non-existent style, but it generated the error message "Error! Use the Home tab to apply No such style to the text that you want to appear here."
I then tried replacing it with a Styleref that referred to "Heading 9" style, which I have not used anywhere in the document, but this generated the same unhelpful text. It appears that you only get the text "Error! No text of specified style in document" for a style that has been used in the document at some time, or a style that is in the "recommended" list in the style gallery.
Another good idea bites the dust.
I then tried replacing it with a Styleref that referred to "Heading 9" style, which I have not used anywhere in the document, but this generated the same unhelpful text. It appears that you only get the text "Error! No text of specified style in document" for a style that has been used in the document at some time, or a style that is in the "recommended" list in the style gallery.
Another good idea bites the dust.
StuartR
-
- Administrator
- Posts: 78625
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: One of six styles in the heading - Word 2003/2007/2010
Stuart,
As long as the document will only be viewed in the English version of Word, your suggestion will work fine!
As long as the document will only be viewed in the English version of Word, your suggestion will work fine!
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 656
- Joined: 18 Feb 2010, 14:26
Re: One of six styles in the heading - Word 2003/2007/2010
Thanks Stuart and Hans.HansV wrote:Stuart,
As long as the document will only be viewed in the English version of Word, your suggestion will work fine!
In my case it is ENGLISH language only so Stuart your code will work fine. Woohoo.
-
- Administrator
- Posts: 12629
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: One of six styles in the heading - Word 2003/2007/2010
But it should be possible to find another way to create this same error message for use in the { IF } field.HansV wrote:...As long as the document will only be viewed in the English version of Word, your suggestion will work fine!
StuartR