WD: Variable Assigned to Comments Field Limited to 127 CharacterLast reviewed: January 30, 1998Article ID: Q73209 |
The information in this article applies to:
SYMPTOMSIf you assign a string variable to the value of the comment field by dimensioning the EditSummaryInfo dialog box in a Microsoft Word for Windows macro, you can only retrieve the first 127 characters from the Comments field.
STATUSMicrosoft has confirmed this to be a problem in the versions of Microsoft Word for Windows listed above. This problem was corrected in Word version 6.0 for Windows. To obtain pre-sales information about new or updated Microsoft products, call the Microsoft Sales Information Center at (800) 426-9400. If you are outside the United States, contact the Microsoft subsidiary for your area. To locate your subsidiary, see the Microsoft World Wide Offices Web site at:
http://www.microsoft.com/worldwide/default.htm MORE INFORMATIONThe Comments field in the Summary Info dialog box can hold up to 256 characters. However, if you assign a string variable to the value of the Comments field (as in the following macro), only the first 127 characters are assigned.
Word for Windows versions 1.0, 1.1 and 1.1a
Sub MAINDim dlg as EditSummaryInfo GetCurValues dlg A$ = dlg.Comment End Sub
Sub MAINDIM dlg as FileSummaryInfo GetCurValues dlg A$=dlg.Comment End SubIf you run this macro, A$ only contains the first 127 characters of the information in the document's Comments field.
WorkaroundYou can extract more than the first 127 characters from the Comments field with the following macro:
Sub MAINEndOfDocument InsertField "comments" CharLeft 1,1 UpdateFields Dim dlg as ViewPreferences GetCurValues dlg If dlg.ShowAll Then Super ShowAll ViewFieldCodes 0 A$=Selection$() EditClear End SubThis macro moves the insertion point to the end of the document and inserts the {comments} field code. Once inserted, it is highlighted, updated to the current value, stored in A$, and removed from the document. So that A$ is assigned the result of the {comments} field instead the name of the field itself, the macro also clears the Show All and Field Codes options to ensure that the result of the field is displayed rather than the field code itself.
REFERENCES"Microsoft Word for Windows and OS/2 Technical Reference," pages 163-164 Kbcategory: kbusage kbmacro KBSubcategory: |
Additional query words: 1.0 1.0 1.10 1.1 1.1a winword2 word6
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |