Hidden text

J

Julie Blatchford

I need to determine if the second page of a 2 page document holds anything other than hidden text
This is to decide whether or not to print 'continued overleaf' on the first page
I am extremely new to VBA programming and am not sure where to look for this
Thank
Julie
 
W

Word Heretic

G'day "Julie Blatchford" <[email protected]>,

Investigate the page num of the last of the range that is sensible.

That is: Content.End has a page num. If its negative, work backwards
until it isnt. That page num tell syou num of pages.

FWIW, you need section break last page and NOT have such text....


Fun huh.

I need to determine if the second page of a 2 page document holds anything other than hidden text.
This is to decide whether or not to print 'continued overleaf' on the first page.
I am extremely new to VBA programming and am not sure where to look for this.
Thanks
Julie

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.
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?SnVsaWUgQmxhdGNoZm9yZA==?=,
I need to determine if the second page of a 2 page document holds anything other than hidden text.
This is to decide whether or not to print 'continued overleaf' on the first page.
I am extremely new to VBA programming and am not sure where to look for this.
I've been thinking about this, and for some odd reason, reading Steve's response triggered a thought
that may help.

Dim rng As Word.Range

'Set a range to a page
Selection.GoTo What:=wdGoToPage, Count:=2
Set rng = Selection.Bookmarks("\Page").Range
'Make sure you're not picking up hidden text
'or field codes
rng.TextRetrievalMode.IncludeHiddenText = False
rng.TextRetrievalMode.IncludeFieldCodes = False
'If the Len of the range = 0, then
'there's no visible text on the page
Debug.Print Len(rng.Text)


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and
not by e-mail :)
 
W

Word Heretic

G'day Cindy M -WordMVP- <[email protected]>,

(juz don't tell anyone n you'll be safe from reprisal)

<more of those long low laughs>



Cindy M -WordMVP- said:
Hi =?Utf-8?B?SnVsaWUgQmxhdGNoZm9yZA==?=,

I've been thinking about this, and for some odd reason, reading Steve's response triggered a thought
that may help.

Dim rng As Word.Range

'Set a range to a page
Selection.GoTo What:=wdGoToPage, Count:=2
Set rng = Selection.Bookmarks("\Page").Range
'Make sure you're not picking up hidden text
'or field codes
rng.TextRetrievalMode.IncludeHiddenText = False
rng.TextRetrievalMode.IncludeFieldCodes = False
'If the Len of the range = 0, then
'there's no visible text on the page
Debug.Print Len(rng.Text)


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and
not by e-mail :)

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.
 
C

Cindy M -WordMVP-

Hi Steve,
(juz don't tell anyone n you'll be safe from reprisal)
<more of those long low laughs>
<ROFL>! I really enjoy the way you can get me to think
around corners, sometimes <g>

Cindy
 
W

Word Heretic

G'day Cindy M -WordMVP- <[email protected]>,

I normally treat it as a lateral thinking exercise, rather than
linear. It does produce some _strange_ results sometimes but ;-)


Cindy M -WordMVP- said:
Hi Steve,

<ROFL>! I really enjoy the way you can get me to think
around corners, sometimes <g>

Cindy

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