The information in this article applies to:
SYMPTOMSWhen you use the WordBasic function BookmarkName$(), you may receive the following error message:
CAUSE
This error message occurs when you attempt to use the BookmarkName$() function with the number of a hidden bookmark.
NOTE: You will receive the same error in Word 97 if you convert this macro
to Visual Basic for Applications, as follows:
WORKAROUNDMicrosoft provides programming examples 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 article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/supportnet/refguide/To work around this problem, you can trap the error as shown in the following macro example. WordBasic (Word 6.x and 7.x):
Visual Basic for Applications (Word 97):
The equivalent Visual Basic for Applications command to display the name of a hidden bookmark works as expected in Word 97, so that error trapping is not needed. This command is as follows:
MORE INFORMATIONBookmarkName$(Count)The BookmarkName$() function in WordBasic returns the name of the bookmark specified by Count.
SelInfo(Type)The SelInfo() function in WordBasic returns one of 37 types of information about the selection, as specified by Type.SelInfo(29) returns the number of the bookmark enclosing the start of the current selection. It returns the value 0 (zero) if the selection is not part of a bookmark, or if the selection is not valid. The number returned corresponds to the position of the bookmark in the document, for example, 1 is the first bookmark, 2 is the second, and so on. REFERENCESFor more information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base: Q163435 VBA: Programming Resources for Visual Basic for Applications Additional query words: 8.0 8.00 vba
Keywords : kberrmsg kbmacro kbprg kbdtacode kbmacroexample word8 winword word6 word7 |
Last Reviewed: January 3, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |