Carriage Return Character Displays as Vertical Bar |
Q113267
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:
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.An error occurred during import...
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.
Sub Enter_Notes()
Dim T As String
T = "ENTER" & Chr(13) & "MORE" & Chr(13) & "NOTES"
Projects(1).Tasks(1).Notes = T
End Sub Microsoft has confirmed this to be a problem in the Microsoft products that are listed at the beginning of this article.
For more information about the & Operator, choose the Search button in the Visual Basic Reference and type:
& (operator)For more information about the Chr Function, choose the Search button in the Visual Basic Reference and type:
Chr
Additional query words: cr lf
Keywords :
Issue type : kbbug
Technology : kbHWMAC kbOSMAC kbProjectSearch kbProject400Mac kbProjectMacSearch kbProject400
|
Last Reviewed: November 5, 2000 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |