WD: WordBasic Examples: Shadow and Shadow()

Last reviewed: February 5, 1998
Article ID: Q123725
The information in this article applies to:
  • Microsoft Word for the Macintosh, version 6.0, 6.0.1, 6.0.1a

SUMMARY

This article contains an example that demonstrates the use of the following WordBasic statement and function:

   Shadow
   Shadow()

This supplements the information in Word Help.

To view this Help topic, choose the Help button on your keyboard, click the Programming with Microsoft Word option, and choose the Search button. Type "shadow" on the query line. Choose the Shadow statement and function option from the list and click the Show Topics button. Choose Shadow, Shadow() in the topic list, and click the Go To button.

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Shadow/Shadow()

Syntax

Shadow [On]

Shadow()

   The On argument tells the Shadow statement to add or remove the shadow
   format. The On argument can have the following values:

   1         Will apply the shadow format to the current selection.
   0(zero)   Removes the shadow format from the current selection.
   Omitted   Toggles the shadow format.

The Shadow statement adds or removes the shadow character format for the current selection. It can also be used to control the shadow format for characters to be inserted at the insertion point.

The Shadow() function will check the format of the current selection and return the following values:

   0(zero)   If none of the selected text has the Shadow format.
  -1         If part of the selected text has the Shadow format.
   1         If all of the selected text has the Shadow format.

NOTE: The Shadow and Shadow() commands are not available on the Windows platform and will generate WordBasic errors.

Example

The following macro will use the Shadow command to turn on the shadow character format for the whole document.

   Sub MAIN:
   EditSelectAll
   Shadow 1
   End Sub

The following macro will check to see if any of the currently selected text has the shadow format. If none of the selected text has the shadow format, the macro will apply the Shadow format to the selection.

   Sub MAIN:
      If (Shadow() = 0) Then
         Shadow
      End If
   End Sub


Additional query words: macro example
Keywords : kbmacroexample macword word6 kbmacro
Version : MACINTOSH:6.0,6.0.1,6.0.1a
Platform : MACINTOSH
Issue type : kbhowto


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.