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

Article translations Article translations
Article ID: 822906 - View products that this article applies to.
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

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:
<p  class=MsoNormal>
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:
<P>

WORKAROUND

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

STATUS

This behavior is by design.

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:
<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:
<html>

<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=Generator content="Microsoft Word 11 (filtered)">
<title>CMS Authoring page</title>
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>
</head>
<body lang=EN-US>
<div class=Section1>
<p class=MsoNormal>CMS Authoring test page.</p>
<p class=MsoNormal>It adds a P  tag in my page.</p>
</div>
</body>
</html>

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>

Properties

Article ID: 822906 - Last Review: February 27, 2014 - Revision: 3.1
APPLIES TO
  • Microsoft Content Management Server 2002
Keywords: 
kbnosurvey kbarchive kbprb kbhowto KB822906

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com