Another article about centering the page...Publ;isher removes themanually entered html code

W

Wintensive

Hi all!

I have appreciated everyones help in the past, a great discussion
group here.

My site is at www.wintensive.com

I would like to center it and have successfully done so using the
following code which was very helpfully posted by another user in this
group (thanks again!):

<table border="0" cellpadding="0" cellspacing="2" width="825"
align="center">
<tr>
<td>
------------------------------------
ABOVE the </body> tag, enter the following:
</td>
</tr>
</table>

However, anytime I go in and make any changes to the site and resave
it, this code is stripped out of it. I tried to use the "Add HTML
Fragment" button, but that doesn't work for code fragments that are
just general formatting things apparently.

Does anyone have any suggestions for the centering problem or any more
info on what the HTML Fragment button is best used for and what it is
bad for. Looking forward to learning more. Thanks!
 
D

Don Schmidt

You could experiment with a program called ReplaceInFiles from
http://www.emurasoft.com/index.htm

I use it with my Publisher 2000 websites. With Publisher 2000 and Publisher
2002 websites RIF is used to insert the single html code
<center> rather easily. I have RIF look for </head> and replace with
</head> <center>

(This find and replace will only work with Publisher 2000 and Publisher
2002; you will need to come up with a more exaggerated data string).

BTW, which version of Publisher are you using?
 
D

DavidF

That is one of the problems with this workaround for centering a Publisher
web page. After you make changes in a Publisher publication, and produce new
html files, you have to edit that code again. And it is totally impractical
if you have to open and edit every page each time. So you do want to
download RepaceInFile and follow Don's directions for Pub 2000 and 2002. For
Pub 2003 and 2007 you will need to take another few steps...

Spike first posted a way of using using Jo's original code with
ReplaceInFile"

Pub 2003 and 2007 from Jo:

"UNDERNEATH the <body> tag, enter (copy and paste will work) this code:(you
may need to change the width)

<table border="0" cellpadding="0" cellspacing="2" width="1000"
align="center">
<tr>
<td>

------------------------------------

ABOVE the </body> tag, enter the following:

</td>
</tr>
</table>


Jo

--------------
Pub 2003 and 2007 from Spike:

Using "replace in files" I found a common point of replacement that appears
to work for me for Publisher 2007.

Since the background changes from one publication to another I found the
closest commonality after <body>.
That turned out to be </v:background></xml><![endif]-->

Since "replace in files" needs to have the entire text on one line I made
the replacement string as shown below.
I also changed the 1000 to 800 to accommodate the 1024 X 768 settings. I
tested it with the settings:
800 X 600
1024 X 768
1440 X 900

Not perfectly centered but real close

Takes two runs of "replace in files"
Once the strings are typed in it just takes selecting the ones you want with
the drop down arrow for Find and Replace With


Find = </v:background></xml><![endif]-->


Replace With = </v:background></xml><![endif]--><table border="0"
cellpadding="0" cellspacing="2" width="800" align="center"><tr><td>



Find </body>

Replace With </td></tr></table></body>

Spike"

-------------------------------------


My notes:

The link to ReplaceInFiles:
http://www.emurasoft.com/replall/index.htm

As centering Publisher pages requires that you edit the code each time you
update your Publisher publication and produce new html, using ReplaceInFiles
to semi-automate the process seems essential to me. It just isn't practical
to open each .htm page in NotePad each time and insert Jo's code manually.

As per Spike's method of using ReplaceInFiles, change the width to the pixel
width of your pages instead of 800. In most cases if you used a default size
in Publisher, it will be 760 pixels.

I also think that each person using ReplaceInFiles will have to find a
"common point of replacement" that is appropriate for your file. In my
limited testing of Spike's method I have not found that the string:
</v:background></xml><![endif]--> is universal.

To find a string to replace in your publication, do a web page preview of
your home page, and then in IE go to View > Source. This will open that page
in NotePad. Then in NotePad go to Edit > Find and type in "body" without the
quotes. Find the first reference to "body" after </head>. That is the first
string that will need to be replaced.

In the case of http://www.wintensive.com/ that string is:

<body link="#0066FF" vlink="#6633CC" bgcolor=black style='margin:0'>

Add Jo's code to that string. I would suggest writing this string in a
second instance of notepad with no word wrap. That way you can make sure the
code is all on one line and correct. Then you can just copy and paste it in
ReplaceInFiles.

Your first Replace With:

<body link="#0066FF" vlink="#6633CC" bgcolor=black style='margin:0'><table
border="0"cellpadding="0" cellspacing="2" width="760"align="center"><tr><td>


The last replacement string would be as Spike describes it:

Find </body>

Replace With </td></tr></table></body>


I have only done limited testing with this, so you may have to play with it
and may find a more efficient way of doing this. But remember that you will
have to do this edit each time to each page after you make any changes in
the Publisher doc, and create new html. Also if you change your page format,
you better check the first body string...it might be different.

It is all a bit of a pain to center Pub 2003 or 2007 website even with
Replaceinfile, and for most may not be worth the effort. Let me know if you
try it, and if you can offer a more efficient way of doing this. Once you
get it setup it will make quick work of editing the code though.

Don, if you are reading this...please feel free to incorporate this "work in
process" into your directions for 2000 and 2002. You have a way of boiling
things down to the essential steps, and your directions are clear, so
please...have at it. Thanks.

DavidF
 
R

Rob Giordano \(Crash\)

It's just one of them walls we spoke about...specifically.
There will be more :-(



--
~~~~~~~~~~~~~~~~~~
Rob Giordano
Microsoft MVP Expression





| That is one of the problems with this workaround for centering a Publisher
| web page. After you make changes in a Publisher publication, and produce
new
| html files, you have to edit that code again. And it is totally
impractical
| if you have to open and edit every page each time. So you do want to
| download RepaceInFile and follow Don's directions for Pub 2000 and 2002.
For
| Pub 2003 and 2007 you will need to take another few steps...
|
| Spike first posted a way of using using Jo's original code with
| ReplaceInFile"
|
| Pub 2003 and 2007 from Jo:
|
| "UNDERNEATH the <body> tag, enter (copy and paste will work) this
code:(you
| may need to change the width)
|
| <table border="0" cellpadding="0" cellspacing="2" width="1000"
| align="center">
| <tr>
| <td>
|
| ------------------------------------
|
| ABOVE the </body> tag, enter the following:
|
| </td>
| </tr>
| </table>
|
|
| Jo
|
| --------------
| Pub 2003 and 2007 from Spike:
|
| Using "replace in files" I found a common point of replacement that
appears
| to work for me for Publisher 2007.
|
| Since the background changes from one publication to another I found the
| closest commonality after <body>.
| That turned out to be </v:background></xml><![endif]-->
|
| Since "replace in files" needs to have the entire text on one line I made
| the replacement string as shown below.
| I also changed the 1000 to 800 to accommodate the 1024 X 768 settings. I
| tested it with the settings:
| 800 X 600
| 1024 X 768
| 1440 X 900
|
| Not perfectly centered but real close
|
| Takes two runs of "replace in files"
| Once the strings are typed in it just takes selecting the ones you want
with
| the drop down arrow for Find and Replace With
|
|
| Find = </v:background></xml><![endif]-->
|
|
| Replace With = </v:background></xml><![endif]--><table border="0"
| cellpadding="0" cellspacing="2" width="800" align="center"><tr><td>
|
|
|
| Find </body>
|
| Replace With </td></tr></table></body>
|
| Spike"
|
| -------------------------------------
|
|
| My notes:
|
| The link to ReplaceInFiles:
| http://www.emurasoft.com/replall/index.htm
|
| As centering Publisher pages requires that you edit the code each time you
| update your Publisher publication and produce new html, using
ReplaceInFiles
| to semi-automate the process seems essential to me. It just isn't
practical
| to open each .htm page in NotePad each time and insert Jo's code manually.
|
| As per Spike's method of using ReplaceInFiles, change the width to the
pixel
| width of your pages instead of 800. In most cases if you used a default
size
| in Publisher, it will be 760 pixels.
|
| I also think that each person using ReplaceInFiles will have to find a
| "common point of replacement" that is appropriate for your file. In my
| limited testing of Spike's method I have not found that the string:
| </v:background></xml><![endif]--> is universal.
|
| To find a string to replace in your publication, do a web page preview of
| your home page, and then in IE go to View > Source. This will open that
page
| in NotePad. Then in NotePad go to Edit > Find and type in "body" without
the
| quotes. Find the first reference to "body" after </head>. That is the
first
| string that will need to be replaced.
|
| In the case of http://www.wintensive.com/ that string is:
|
| <body link="#0066FF" vlink="#6633CC" bgcolor=black style='margin:0'>
|
| Add Jo's code to that string. I would suggest writing this string in a
| second instance of notepad with no word wrap. That way you can make sure
the
| code is all on one line and correct. Then you can just copy and paste it
in
| ReplaceInFiles.
|
| Your first Replace With:
|
| <body link="#0066FF" vlink="#6633CC" bgcolor=black style='margin:0'><table
| border="0"cellpadding="0" cellspacing="2"
width="760"align="center"><tr><td>
|
|
| The last replacement string would be as Spike describes it:
|
| Find </body>
|
| Replace With </td></tr></table></body>
|
|
| I have only done limited testing with this, so you may have to play with
it
| and may find a more efficient way of doing this. But remember that you
will
| have to do this edit each time to each page after you make any changes in
| the Publisher doc, and create new html. Also if you change your page
format,
| you better check the first body string...it might be different.
|
| It is all a bit of a pain to center Pub 2003 or 2007 website even with
| Replaceinfile, and for most may not be worth the effort. Let me know if
you
| try it, and if you can offer a more efficient way of doing this. Once you
| get it setup it will make quick work of editing the code though.
|
| Don, if you are reading this...please feel free to incorporate this "work
in
| process" into your directions for 2000 and 2002. You have a way of boiling
| things down to the essential steps, and your directions are clear, so
| please...have at it. Thanks.
|
| DavidF
|
|
|
| | > Hi all!
| >
| > I have appreciated everyones help in the past, a great discussion
| > group here.
| >
| > My site is at www.wintensive.com
| >
| > I would like to center it and have successfully done so using the
| > following code which was very helpfully posted by another user in this
| > group (thanks again!):
| >
| > <table border="0" cellpadding="0" cellspacing="2" width="825"
| > align="center">
| > <tr>
| > <td>
| > ------------------------------------
| > ABOVE the </body> tag, enter the following:
| > </td>
| > </tr>
| > </table>
| >
| > However, anytime I go in and make any changes to the site and resave
| > it, this code is stripped out of it. I tried to use the "Add HTML
| > Fragment" button, but that doesn't work for code fragments that are
| > just general formatting things apparently.
| >
| > Does anyone have any suggestions for the centering problem or any more
| > info on what the HTML Fragment button is best used for and what it is
| > bad for. Looking forward to learning more. Thanks!
|
|
 
D

DavidF

Web building with Publisher is like a box of chocolate, you bite in and you
never know what wall you might walk into...in my best tom hanks voice. ;-)

DavidF

Rob Giordano (Crash) said:
It's just one of them walls we spoke about...specifically.
There will be more :-(



--
~~~~~~~~~~~~~~~~~~
Rob Giordano
Microsoft MVP Expression





| That is one of the problems with this workaround for centering a
Publisher
| web page. After you make changes in a Publisher publication, and produce
new
| html files, you have to edit that code again. And it is totally
impractical
| if you have to open and edit every page each time. So you do want to
| download RepaceInFile and follow Don's directions for Pub 2000 and 2002.
For
| Pub 2003 and 2007 you will need to take another few steps...
|
| Spike first posted a way of using using Jo's original code with
| ReplaceInFile"
|
| Pub 2003 and 2007 from Jo:
|
| "UNDERNEATH the <body> tag, enter (copy and paste will work) this
code:(you
| may need to change the width)
|
| <table border="0" cellpadding="0" cellspacing="2" width="1000"
| align="center">
| <tr>
| <td>
|
| ------------------------------------
|
| ABOVE the </body> tag, enter the following:
|
| </td>
| </tr>
| </table>
|
|
| Jo
|
| --------------
| Pub 2003 and 2007 from Spike:
|
| Using "replace in files" I found a common point of replacement that
appears
| to work for me for Publisher 2007.
|
| Since the background changes from one publication to another I found the
| closest commonality after <body>.
| That turned out to be </v:background></xml><![endif]-->
|
| Since "replace in files" needs to have the entire text on one line I
made
| the replacement string as shown below.
| I also changed the 1000 to 800 to accommodate the 1024 X 768 settings.
I
| tested it with the settings:
| 800 X 600
| 1024 X 768
| 1440 X 900
|
| Not perfectly centered but real close
|
| Takes two runs of "replace in files"
| Once the strings are typed in it just takes selecting the ones you want
with
| the drop down arrow for Find and Replace With
|
|
| Find = </v:background></xml><![endif]-->
|
|
| Replace With = </v:background></xml><![endif]--><table border="0"
| cellpadding="0" cellspacing="2" width="800" align="center"><tr><td>
|
|
|
| Find </body>
|
| Replace With </td></tr></table></body>
|
| Spike"
|
| -------------------------------------
|
|
| My notes:
|
| The link to ReplaceInFiles:
| http://www.emurasoft.com/replall/index.htm
|
| As centering Publisher pages requires that you edit the code each time
you
| update your Publisher publication and produce new html, using
ReplaceInFiles
| to semi-automate the process seems essential to me. It just isn't
practical
| to open each .htm page in NotePad each time and insert Jo's code
manually.
|
| As per Spike's method of using ReplaceInFiles, change the width to the
pixel
| width of your pages instead of 800. In most cases if you used a default
size
| in Publisher, it will be 760 pixels.
|
| I also think that each person using ReplaceInFiles will have to find a
| "common point of replacement" that is appropriate for your file. In my
| limited testing of Spike's method I have not found that the string:
| </v:background></xml><![endif]--> is universal.
|
| To find a string to replace in your publication, do a web page preview
of
| your home page, and then in IE go to View > Source. This will open that
page
| in NotePad. Then in NotePad go to Edit > Find and type in "body" without
the
| quotes. Find the first reference to "body" after </head>. That is the
first
| string that will need to be replaced.
|
| In the case of http://www.wintensive.com/ that string is:
|
| <body link="#0066FF" vlink="#6633CC" bgcolor=black style='margin:0'>
|
| Add Jo's code to that string. I would suggest writing this string in a
| second instance of notepad with no word wrap. That way you can make sure
the
| code is all on one line and correct. Then you can just copy and paste it
in
| ReplaceInFiles.
|
| Your first Replace With:
|
| <body link="#0066FF" vlink="#6633CC" bgcolor=black
style='margin:0'><table
| border="0"cellpadding="0" cellspacing="2"
width="760"align="center"><tr><td>
|
|
| The last replacement string would be as Spike describes it:
|
| Find </body>
|
| Replace With </td></tr></table></body>
|
|
| I have only done limited testing with this, so you may have to play with
it
| and may find a more efficient way of doing this. But remember that you
will
| have to do this edit each time to each page after you make any changes
in
| the Publisher doc, and create new html. Also if you change your page
format,
| you better check the first body string...it might be different.
|
| It is all a bit of a pain to center Pub 2003 or 2007 website even with
| Replaceinfile, and for most may not be worth the effort. Let me know if
you
| try it, and if you can offer a more efficient way of doing this. Once
you
| get it setup it will make quick work of editing the code though.
|
| Don, if you are reading this...please feel free to incorporate this
"work
in
| process" into your directions for 2000 and 2002. You have a way of
boiling
| things down to the essential steps, and your directions are clear, so
| please...have at it. Thanks.
|
| DavidF
|
|
|
|
| > Hi all!
| >
| > I have appreciated everyones help in the past, a great discussion
| > group here.
| >
| > My site is at www.wintensive.com
| >
| > I would like to center it and have successfully done so using the
| > following code which was very helpfully posted by another user in this
| > group (thanks again!):
| >
| > <table border="0" cellpadding="0" cellspacing="2" width="825"
| > align="center">
| > <tr>
| > <td>
| > ------------------------------------
| > ABOVE the </body> tag, enter the following:
| > </td>
| > </tr>
| > </table>
| >
| > However, anytime I go in and make any changes to the site and resave
| > it, this code is stripped out of it. I tried to use the "Add HTML
| > Fragment" button, but that doesn't work for code fragments that are
| > just general formatting things apparently.
| >
| > Does anyone have any suggestions for the centering problem or any more
| > info on what the HTML Fragment button is best used for and what it is
| > bad for. Looking forward to learning more. Thanks!
|
|
 
R

Rob Giordano \(Crash\)

Ha!



--
~~~~~~~~~~~~~~~~~~
Rob Giordano
Microsoft MVP Expression





| Web building with Publisher is like a box of chocolate, you bite in and
you
| never know what wall you might walk into...in my best tom hanks voice. ;-)
|
| DavidF
|
| | > It's just one of them walls we spoke about...specifically.
| > There will be more :-(
| >
| >
| >
| > --
| > ~~~~~~~~~~~~~~~~~~
| > Rob Giordano
| > Microsoft MVP Expression
| >
| >
| >
| >
| >
| > | > | That is one of the problems with this workaround for centering a
| > Publisher
| > | web page. After you make changes in a Publisher publication, and
produce
| > new
| > | html files, you have to edit that code again. And it is totally
| > impractical
| > | if you have to open and edit every page each time. So you do want to
| > | download RepaceInFile and follow Don's directions for Pub 2000 and
2002.
| > For
| > | Pub 2003 and 2007 you will need to take another few steps...
| > |
| > | Spike first posted a way of using using Jo's original code with
| > | ReplaceInFile"
| > |
| > | Pub 2003 and 2007 from Jo:
| > |
| > | "UNDERNEATH the <body> tag, enter (copy and paste will work) this
| > code:(you
| > | may need to change the width)
| > |
| > | <table border="0" cellpadding="0" cellspacing="2" width="1000"
| > | align="center">
| > | <tr>
| > | <td>
| > |
| > | ------------------------------------
| > |
| > | ABOVE the </body> tag, enter the following:
| > |
| > | </td>
| > | </tr>
| > | </table>
| > |
| > |
| > | Jo
| > |
| > | --------------
| > | Pub 2003 and 2007 from Spike:
| > |
| > | Using "replace in files" I found a common point of replacement that
| > appears
| > | to work for me for Publisher 2007.
| > |
| > | Since the background changes from one publication to another I found
the
| > | closest commonality after <body>.
| > | That turned out to be </v:background></xml><![endif]-->
| > |
| > | Since "replace in files" needs to have the entire text on one line I
| > made
| > | the replacement string as shown below.
| > | I also changed the 1000 to 800 to accommodate the 1024 X 768 settings.
| > I
| > | tested it with the settings:
| > | 800 X 600
| > | 1024 X 768
| > | 1440 X 900
| > |
| > | Not perfectly centered but real close
| > |
| > | Takes two runs of "replace in files"
| > | Once the strings are typed in it just takes selecting the ones you
want
| > with
| > | the drop down arrow for Find and Replace With
| > |
| > |
| > | Find = </v:background></xml><![endif]-->
| > |
| > |
| > | Replace With = </v:background></xml><![endif]--><table border="0"
| > | cellpadding="0" cellspacing="2" width="800" align="center"><tr><td>
| > |
| > |
| > |
| > | Find </body>
| > |
| > | Replace With </td></tr></table></body>
| > |
| > | Spike"
| > |
| > | -------------------------------------
| > |
| > |
| > | My notes:
| > |
| > | The link to ReplaceInFiles:
| > | http://www.emurasoft.com/replall/index.htm
| > |
| > | As centering Publisher pages requires that you edit the code each time
| > you
| > | update your Publisher publication and produce new html, using
| > ReplaceInFiles
| > | to semi-automate the process seems essential to me. It just isn't
| > practical
| > | to open each .htm page in NotePad each time and insert Jo's code
| > manually.
| > |
| > | As per Spike's method of using ReplaceInFiles, change the width to the
| > pixel
| > | width of your pages instead of 800. In most cases if you used a
default
| > size
| > | in Publisher, it will be 760 pixels.
| > |
| > | I also think that each person using ReplaceInFiles will have to find a
| > | "common point of replacement" that is appropriate for your file. In my
| > | limited testing of Spike's method I have not found that the string:
| > | </v:background></xml><![endif]--> is universal.
| > |
| > | To find a string to replace in your publication, do a web page preview
| > of
| > | your home page, and then in IE go to View > Source. This will open
that
| > page
| > | in NotePad. Then in NotePad go to Edit > Find and type in "body"
without
| > the
| > | quotes. Find the first reference to "body" after </head>. That is the
| > first
| > | string that will need to be replaced.
| > |
| > | In the case of http://www.wintensive.com/ that string is:
| > |
| > | <body link="#0066FF" vlink="#6633CC" bgcolor=black style='margin:0'>
| > |
| > | Add Jo's code to that string. I would suggest writing this string in a
| > | second instance of notepad with no word wrap. That way you can make
sure
| > the
| > | code is all on one line and correct. Then you can just copy and paste
it
| > in
| > | ReplaceInFiles.
| > |
| > | Your first Replace With:
| > |
| > | <body link="#0066FF" vlink="#6633CC" bgcolor=black
| > style='margin:0'><table
| > | border="0"cellpadding="0" cellspacing="2"
| > width="760"align="center"><tr><td>
| > |
| > |
| > | The last replacement string would be as Spike describes it:
| > |
| > | Find </body>
| > |
| > | Replace With </td></tr></table></body>
| > |
| > |
| > | I have only done limited testing with this, so you may have to play
with
| > it
| > | and may find a more efficient way of doing this. But remember that you
| > will
| > | have to do this edit each time to each page after you make any changes
| > in
| > | the Publisher doc, and create new html. Also if you change your page
| > format,
| > | you better check the first body string...it might be different.
| > |
| > | It is all a bit of a pain to center Pub 2003 or 2007 website even with
| > | Replaceinfile, and for most may not be worth the effort. Let me know
if
| > you
| > | try it, and if you can offer a more efficient way of doing this. Once
| > you
| > | get it setup it will make quick work of editing the code though.
| > |
| > | Don, if you are reading this...please feel free to incorporate this
| > "work
| > in
| > | process" into your directions for 2000 and 2002. You have a way of
| > boiling
| > | things down to the essential steps, and your directions are clear, so
| > | please...have at it. Thanks.
| > |
| > | DavidF
| > |
| > |
| > |
| > |
| >
| > | > Hi all!
| > | >
| > | > I have appreciated everyones help in the past, a great discussion
| > | > group here.
| > | >
| > | > My site is at www.wintensive.com
| > | >
| > | > I would like to center it and have successfully done so using the
| > | > following code which was very helpfully posted by another user in
this
| > | > group (thanks again!):
| > | >
| > | > <table border="0" cellpadding="0" cellspacing="2" width="825"
| > | > align="center">
| > | > <tr>
| > | > <td>
| > | > ------------------------------------
| > | > ABOVE the </body> tag, enter the following:
| > | > </td>
| > | > </tr>
| > | > </table>
| > | >
| > | > However, anytime I go in and make any changes to the site and resave
| > | > it, this code is stripped out of it. I tried to use the "Add HTML
| > | > Fragment" button, but that doesn't work for code fragments that are
| > | > just general formatting things apparently.
| > | >
| > | > Does anyone have any suggestions for the centering problem or any
more
| > | > info on what the HTML Fragment button is best used for and what it
is
| > | > bad for. Looking forward to learning more. Thanks!
| > |
| > |
| >
| >
|
|
 
W

Wintensive

Hi All,

Thanks for the help, as usual. Well, it looks like Publisher has a
major flaw with this little situation. In any case, the replace files
program at least sounds like a way to automate the process across
several pages you need to do this with. I will try it and let you
knwo what my luck is witht he procedure.

Jason
 
W

Wintensive

Thanks for the ideas. What is the best way/order to make the edits.
Should I save or publish to a local file, then do the Replaceinfiles
routine, then manuall ftp the htm file to my site?
 

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