Microsoft KB Archive/113267

{|
 * width="100%"|

Carriage Return Character Displays as Vertical Bar

 * }

Q113267

-

The information in this article applies to:


 * Microsoft Project for Windows, version 4.0
 * Microsoft Project for the Macintosh, version 4.0

-

SYMPTOMS
In Microsoft Project, when you create a macro that adds a note to a task, if you use the carriage return character (character code 13) to add a new line to the note, the following problems occur:

 The character displays as a vertical bar and does not start a new line of information.  If you save the project that contains the note with this character to the .MPX file format, and open the project again, you receive the following error message

An error occurred during import...

If you choose Yes to continue importing the file, you'll see that any information following the carriage return character in the task note is missing. 

WORKAROUND
When you use a macro to add a note to a task, and you want the note to contain multiple lines of information, use the line feed character (character code 10), as in the following example:

  Sub Enter_Notes Dim T As String T = "ENTER" & Chr(10) & "MORE" & Chr(10) & "NOTES" Projects(1).Tasks(1).Notes = T  End Sub Microsoft provides examples of Visual Basic procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This Visual Basic procedure is provided 'as is' and Microsoft does not guarantee that it can be used in all situations. Microsoft does not support modifications of this procedure to suit customer requirements for a particular purpose. Note that a line that is preceded by an apostrophe introduces a comment in the code--comments are provided to explain what the code is doing at a particular point in the procedure. Note also that an underscore character (_) indicates that code continues from one line to the next. You can type lines that contain this character as one logical line or you can divide the lines of code and include the line continuation character.

Steps to Reproduce Behavior

 * 1) In a new project, choose Macro from the Tools menu. Choose the New button. In the Macro Name box, type Enter_Notes. Choose the Options button, and under Store Macro In, select the Current Project File option and choose OK.
 * 2) In the new macro, enter the following:
 * 3) From the View menu, choose Gantt Chart.
 * 4) In the Task Name field in row 1, enter a task, T1. Select T1.
 * 5) From the Tools menu, choose Macros. From the Macro Name list, select Enter_Notes, and choose Run.
 * 6) Select Task1, and choose Task Information from the Insert menu. Select the Notes tab.

Note that the character following the words ENTER and MORE is a vertical bar.

STATUS
Microsoft has confirmed this to be a problem in the Microsoft products that are listed at the beginning of this article.