You are using <p> when you should probably be using <pre>
(the div is your background color)
Change
<div style="background-color: #C0C0C0">
<p class="Code"><font face="Courier New" size="2">
......Your Code Here
</font></p></div>
To
<div style="background-color: #C0C0C0"><pre>
......Your Code Here
</pre></div>
Then in Code view just paste your code inside the pre tags
For new sections just copy the above to a new page and paste your new code over your old code
"Richard Lewis Haggard" <HaggardAtWorldDotStdDotCom> wrote in message | Thank you, that's very kind.
|
| As an example, here's what I'm trying to accomplish:
|
|
http://www.haggard-and-associates.com/Deveoper Resources/MFC/Error_Report.htm
|
| Typically, I lay out a web page in the normal FrontPage way and when I want
| to insert some code, I copy it from MsDev and paste it into the web page.
| Invariably, the results are not particularly appealing. The first step is to
| replace the end-of-line paragraphs with a line break so that the text has
| the right spacing from line to line. This is done by clicking on the line,
| hitting the End key, pressing and holding the shift key and then pressing
| the right arrow key. That selects the paragraph mark. To replace it with a
| line break, I hit the Enter key while still holding the shift key. This is
| repeated for each line that was pasted.
|
| OK, now the line spacing is what I want. Now I want to assert Courier New 10
| pt. I can't remember off the top of my head if I have to actually select the
| entire text or if I simply right click anywhere within the newly modified
| lines as assert the desired font.
|
| Finally, I want the code text to be on a light gray background. I right
| click anywhere in the modified text lines and then use the Format\Borders
| and Shading\Shading command to select a light gray background.
|
| See why I'd like to do this in a macro? I've set up a macro in Word that
| does exactly that but was unable to copy that macro into FP and have it
| work.
| ===
| "Some days you're the windshield. Some days you're the bug. Get over it."
| Richard Lewis Haggard
|
| | > Hi, Richard,
| >
| > I can probably help you, but I'm having difficulty understanding exactly
| > what you want to do. I know the Word object model fairly well, and all
| > the
| > macro you provided does is insert a soft line break at the end of the
| > line.
| > As Ronx pointed out, there is no such thing as line feed or carriage
| > return
| > in HTML, and unfortunately, FrontPage doesn't know the end of the line
| > from
| > the beginning, so the best that you could do is create a macro that
| > inserts
| > the <br> tag (which is a soft line break in HTML) and the position of the
| > insertion point. This is a relatively easy macro. If you are interested,
| > please let me know. You can contact me directly at
| > (e-mail address removed).
| > I'd be happy to help you create the macros that you need.
| >
| > You might also check out the article Working with HTML Using the FrontPage
| > 2003 Object Model at
| >
http://msdn.microsoft.com/library/d...tml/odc_fpworkingwithhtmlprogrammatically.asp.
| > This article explains in detail how to use the FrontPage object model to
| > manipulate HTML.
| >
| > --
| > Lisa Wollin
| > Programmer Writer
| > Microsoft Corporation
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| > rights.
| > Use of included code samples are subject to the terms specified at
| >
http://www.microsoft.com/info/cpyright.htm.
| > "Richard Lewis Haggard" <HaggardAtWorldDotStdDotCom> wrote in message
| > | >> One of the things I have to do repeatedly is to reformat text in a manner
| >> that is more appropriate to code. I'd like to automate the process in a
| >> macro but I am having a little trouble figuring out how to do it.
| >>
| >> Here's the sequence of events I'd like to accomplish:
| >>
| >> Search forward for a new line.
| >> Select the new line characters.
| >> Replace the new line with a carriage return.
| >> Assert a shading of light gray.
| >> Assign a font of Courier New, 12 pt to the paragraph.
| >>
| >> In Word, this was dead simple and I thought I could just copy the macro
| > over
| >> to FrontPage. However, that didn't work because the FrontPage VBA didn't
| >> recognize all of the Word VBA objects. This is the macro from Word that
| >> replaces the carriage return with a new line. It fails in FrontPage.
| >>
| >> Sub LineBreakReplacesParagraph()
| >> '
| >> ' LineBreakReplacesParagraph Macro
| >> ' Macro recorded 2/29/2004 by Richard Lewis Haggard
| >> '
| >> Selection.EndKey Unit:=wdLine
| >> Selection.TypeText Text:=Chr(11)
| >> Selection.Delete Unit:=wdCharacter, Count:=1
| >> End Sub
| >>
| >> Any suggestions on how to make the macro work in FP 2003?
| >>
| >> --
| >> ----------
| >> Richard Lewis Haggard
| >>
| >>
| >
| >
|
|