Or_A
asked on
changing text inside footer/header by vb code
hi,
is there a way to say in vb under word doc:
dim n as integer
n=0
for each word in this document's headers and footers (lets say there's only one duplicated header and footer for every page), n=n+1? (i know it will also count commas, spaces etc.. i dont care)
thanks!
is there a way to say in vb under word doc:
dim n as integer
n=0
for each word in this document's headers and footers (lets say there's only one duplicated header and footer for every page), n=n+1? (i know it will also count commas, spaces etc.. i dont care)
thanks!
ASKER
thanks,
but my real intension is not counting the words, but to replace words that begins with FLD with lets say the word Try, so i planned to put this code lines:
dim str as string
str="Try"
(for each word in the headers and footers)
for n=1 to (footer/header.words.count - not sure how to write this)
if left$(trim$(words(n).text, 3)="FLD" then (here too, im not sure if "words(n)" is correct to write)
words(n).text=str
next n
can you please arrange together what you wrote and what i wrote to one complete code?
thanks!
but my real intension is not counting the words, but to replace words that begins with FLD with lets say the word Try, so i planned to put this code lines:
dim str as string
str="Try"
(for each word in the headers and footers)
for n=1 to (footer/header.words.count
if left$(trim$(words(n).text,
words(n).text=str
next n
can you please arrange together what you wrote and what i wrote to one complete code?
thanks!
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
If that's what you want.
Open in new window