?
Solved

Dynmic Header - based on text in middle of line

Posted on 2013-05-26
3
Medium Priority
?
307 Views
Last Modified: 2013-05-28
A follow up Q to
https://secure.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Word/Q_28135765.html

It seems that it only picks up the StyleRef of text that is in the beginning of the line.  How would I do this if my ID's are often in the middle of lines?

thx
0
Comment
Question by:endurance
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 1000 total points
ID: 39197822
Are you using a paragraph type of style? That is the usual way, but I would expect it to be limited to a whole paragraph.
Try using a character style. That should work wherever the text comes in a pargraph.
0
 
LVL 21

Accepted Solution

by:
Eric Fletcher earned 1000 total points
ID: 39199977
A character style will do what you want. Note that the default setting for the STYLEREF field code is to display the 1st instance found on the page; add the "\l" switch if you want to show the last one on a given page.

As an added benefit of using a character style for this, you can then use Find to select all content that uses the style. Then drop out of the Find dialog, copy, and paste into a new document. This will give you a full list of all content tagged with the given style.
0
 

Author Comment

by:endurance
ID: 39201418
thx
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question