Copying 2nd line of header

T

Tyson Ackland

How does one programmatically locate the first header in a Word doc and then
copy the second line of text from it for use elsewhere in the VBA code?
TIA!

TyBreaker
 
W

Word Heretic

G'day "Tyson Ackland" <[email protected]>,

activedocument.storyranges(whatever).sections(1).range.paragraphs(2).range.text


Tyson Ackland said:
How does one programmatically locate the first header in a Word doc and then
copy the second line of text from it for use elsewhere in the VBA code?
TIA!

TyBreaker

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

Replies offlist may require payment.
 
J

Jeffrey Bradshaw

I need to do the same thing but I don't need the paragraph - I need the
actual line (wherever Word has broken the paragraph into multiple lines.)

In the story, you look for a bookmark called "\LINE" and that get's the next
line. But that doesn't seem to exist in the Header/Footer.

Got any suggestions?

TIA - Jeffrey
 
W

Word Heretic

G'day "Jeffrey Bradshaw" <[email protected]>,

copy the head/foot content to the body of a temp doc and process it
from there


I need to do the same thing but I don't need the paragraph - I need the
actual line (wherever Word has broken the paragraph into multiple lines.)

In the story, you look for a bookmark called "\LINE" and that get's the next
line. But that doesn't seem to exist in the Header/Footer.

Got any suggestions?

TIA - Jeffrey

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

If my answers r 2 terse, ask again or hassle an MVP,
at least they get recognition for it then.
Lengthy replies offlist require payment.
 

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