Microsoft KB Archive/822906

= PRB: Extra carriage return for a CMS posting is created from a Word Authoring Connector =

Article ID: 822906

Article Last Modified on 10/26/2004

-

APPLIES TO


 * Microsoft Content Management Server 2002

-



SYMPTOMS
If you create Content Management Server content by using Microsoft Word Authoring Connector for Content Management Server (MCMS), when you insert a carriage return (when you press ENTER) in the Word document, MCMS converts the single carriage return (also known as a hard return) to double-spaced line spacing and inserts an extra carriage return.



CAUSE
Word uses inline styles to format documents. In this case, Word inserts the following Hypertext Markup Language (HTML) tag:



As a result, an extra carriage return is added when the page is displayed in the browser.

When you view the source code that is rendered for the browser (click View Source), a paragraph tag (instead of a line break) is inserted in the text. The paragraph tag appears as follows:





WORKAROUND
To work around this behavior, follow these steps:  Start Visual Studio .NET IDE, and then open a Content Management Server 2002 Web project. Create a new Content Management Server template. In Template Explorer, create a new Template Gallery Item (TGI.) Associate the template ASPX file to a TGI Placeholder definition. Make sure that you select a member of the OfficeHtmlPlaceHolderDefinition attribute for the TGI. In Microsoft Word, open a new document, and then save the file as Web page, filtered file type.</li> In a text editor such as Notepad, open the file that you saved in the previous step.</li>  Copy the inline style definition from the file that you saved from Word, as shown in the following: <meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=windows-1252&quot;> <meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11 (filtered)&quot;> @font-face { font-family: Tahoma; } @page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; } P.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: &quot;Times New Roman&quot; } LI.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: &quot;Times New Roman&quot; } DIV.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: &quot;Times New Roman&quot; } DIV.Section1 { page: Section1 } </li>  Go back to the Content Management Server template HTML code editor. Paste the inline style definition as shown in the following: <%@ Register TagPrefix=&quot;uc1&quot; TagName=&quot;DefaultConsole&quot; Src=&quot;../Console/DefaultConsole.ascx&quot; %> <%@ Page language=&quot;c#&quot; Codebehind=&quot;WordTemplate.aspx.cs&quot; AutoEventWireup=&quot;false&quot; Inherits=&quot;WordAuthoringWeb.Templates.WordTemplate&quot; %> <%@ Register TagPrefix=&quot;cms&quot; Namespace=&quot;Microsoft.ContentManagement.WebControls&quot; Assembly=&quot;Microsoft.ContentManagement.WebControls, Version=5.0.1200.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot; %> <!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot; > <HTML> <HEAD> WordTemplate <meta name=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual Studio 7.0&quot;> <meta name=&quot;CODE_LANGUAGE&quot; Content=&quot;C#&quot;> <meta name=&quot;vs_defaultClientScript&quot; content=&quot;JavaScript&quot;> <meta name=&quot;vs_targetSchema&quot; content=&quot;http://schemas.microsoft.com/intellisense/ie5&quot;> <cms:RobotMetaTag runat=&quot;server&quot; id=&quot;RobotMetaTag1&quot;></cms:RobotMetaTag> <meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=windows-1252&quot;> <meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11 (filtered)&quot;> @font-face { font-family: Tahoma; } @page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; } P.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: &quot;Times New Roman&quot; } LI.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: &quot;Times New Roman&quot; } DIV.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: &quot;Times New Roman&quot; } DIV.Section1 { page: Section1 } </HEAD> </li> In the template that you created in step 2, select htmPlaceholderControl. In the properties of htmPlacehoderControl, set PlaceholderToBind to the TGI that you defined in step 3.</li> Compile the Content Management Server Web project.</li> Create a posting from Word Authoring Connector.</li></ol>

<div class="status_section">

STATUS
This behavior is by design.

<div class="moreinformation_section">

MORE INFORMATION
When a text stream is inserted in a Content Management Server Placeholder control, Content Management Server removes some of the HTML tags, such as the following style tag:

<pre class="fixed_text"><Style>

In the following comparison between HTML content that is saved from a Word file and HTML content that is shown in a Placeholder in edit mode, note the following about the HTML:
 * You can see the HTML tag format if you set the AllowHtmlSourceEditing attribute to True in a Content Management Server 2002 Active Server Page Framework (ASPX) template file.
 * If you strip the <Style> tag from an HTML file that is saved from a Word file, you will see the exact same behavior as you see in a Content Management Server page that is created by Word Authoring Connector.
 * If you try to add the same <Style> definition in a Content Management Server Placeholder during authoring mode, you will notice that the Content Management Server Placeholder strips these tags out eventually.

HTML content in a Word file
An HTML file that is saved from a Word document contains the following tags:

<meta http-equiv=Content-Type content=&quot;text/html; charset=windows-1252&quot;> <meta name=Generator content=&quot;Microsoft Word 11 (filtered)&quot;> CMS Authoring page

<body lang=EN-US> <p class=MsoNormal>CMS Authoring test page. <p class=MsoNormal>It adds a P tag in my page.

HTML content in a placeholder
HTML content in a Content Management Server 2002 Placeholder in edit mode contains the following tags: <DIV class=Section1> <P class=MsoNormal>CMS Authoring test page.</P> <P class=MsoNormal>It adds a P tag in my page.</P> <P class=MsoNormal></P></DIV>

Keywords: kbhowto kbprb KB822906

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.