GetBookMark$ Returns Value and Form Field Name

Last reviewed: February 5, 1998
Article ID: Q123693
The information in this article applies to:
  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows 95, version 7.0

SUMMARY

If you use the WordBasic GetBookMark$() function to return the value of a form field bookmark, the form field name and value are returned. For example, if you have a text box form field named "text1," the following macro returns the word "FORMTEXT" followed by the text typed into the text1 form field.

Sub Main
Name$ = GetBookmark$("text1") MsgBox Name$
End Sub

If you type the name John in the text1 form field, the above macro displays the following string:

   FORMTEXT John

To correctly retrieve information from form fields, use the GetFormResult$() or GetFormResult() function.

The following macro example correctly returns only the text typed into the text1 form field.

Sub Main
Name$ = GetFormResult$("text1") Msgbox Name$
End Sub

For more information on the GetFormResult$() and GetFormResult() functions, see the "GetFormResult$() function" topic in the Word 6.0 Help file.

REFERENCES

"Microsoft Word Developer's Kit," for version 6.0, pages 491-494


KBCategory: kbusage kbmacro
KBSubcategory:
Additional reference words: 6.0 6.0a 6.0c winword form forms word6
7.0 word95 word7 word7 7.0 word95 GetFormResult GetFormResult$
Version : 6.0 6.0a 6.0c 7.0
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 5, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.