different align in footer - word - macro

4

4tis

hi
i am tryiing to read the text of a footer with the function
txt =
ActiveDocument.Sections(1).Footers(wdHeaderFooterFirstPage).Range.Text

then i am changing some data in the string (i got all the footer in one
string) and then write the string back to the footer in the same
function

ActiveDocument.Sections(1).Footers(wdHeaderFooterFirstPage).Range.Text
= txt

my problem is
at the first line i have a page number in the center
at the second line i have a string that i edit in the right side of the
page
after writing the string back all the text including the page number is
right align
how can i write the footer and align any line to the side i want ?

thhanks in advanced
 
C

Cindy M.

Hi 4tis,

When you pick up an work with a string, you only get the text; no
formatting information. When you put the text back in, replacing what's
there, the formatting is lost.

What you need to do is work only with the text you need to change, and
you have to be able to identify this in a more exact manner. Can you
describe what text part you need to work with? And how is the footer laid
out (what kind of formatting to put what, where)?
I am tryiing to read the text of a footer with the function
txt =
ActiveDocument.Sections(1).Footers(wdHeaderFooterFirstPage).Range.Text

then i am changing some data in the string (i got all the footer in one
string) and then write the string back to the footer in the same
function

ActiveDocument.Sections(1).Footers(wdHeaderFooterFirstPage).Range.Text
= txt

my problem is
at the first line i have a page number in the center
at the second line i have a string that i edit in the right side of the
page
after writing the string back all the text including the page number is
right align
how can i write the footer and align any line to the side i want ?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

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

4tis

in the footer there are some text lines some field like page numberes
and and other stuff
i need to find a string with the structure of "*/*/*/*/*" and replace
that string with a new string and all of this without loosing any kind
of design or alingment

thank you
 
C

Cindy M.

Hi 4tis,
in the footer there are some text lines some field like page numberes
and and other stuff
i need to find a string with the structure of "*/*/*/*/*" and replace
that string with a new string and all of this without loosing any kind
of design or alingment
Have you tried using Find/Replace with wildcards? Experiment with this a
bit in the UI, then record what works in a macro. We can then help you
"tweak" the result into proper code...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

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

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