WordBasic Examples: Insert Commands

Last reviewed: July 30, 1997
Article ID: Q106199
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

This article contains an example that demonstrates the use of the following WordBasic statements or functions:

   InsertSound

   InsertWordArt

   InsertChart

   InsertDatabase

   InsertDrawing

   InsertEquation

   InsertExcelTable

This article supplements the information in online Help. To open this Help topic, choose Contents from the Help menu and then choose the "Programming with Microsoft Word" topic.

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.

InsertSound

Syntax

InsertSound

InsertWordArt

Syntax

InsertWordArt

All of the commands listed above follow the same syntax as InsertSound and InsertWordArt. The only exception is InsertDatabase. A syntax example for InsertDatabase follows:

InsertDatabase

Syntax

InsertDatabase [.Format = number] [, .Style = number] [, .LinkToSource = number] [, .Connection = text] [, .SQLStatement = text] [, .SQLStatement1 = text] [, .PasswordDoc = text] [, .PasswordDot = text] [, .DataSource = text] [, .From = text] [, .To = text] [, .IncludeFields = number]

Macro Example

Sub MAIN
Begin Dialog UserDialog 306, 214, "Object Selector"
    GroupBox 45, 25, 204, 150, "Insert which type of object?"
    OptionGroup  .OptionGroup1
        OptionButton 57, 50, 111, 16, "InsertSound", .OptionButton1
        OptionButton 57, 65, 123, 16, "InsertWordArt", .OptionButton2
        OptionButton 57, 80, 103, 16, "InsertChart", .OptionButton3
        OptionButton 57, 110, 123, 16, "InsertDrawing", .OptionButton4
        OptionButton 57, 125, 128, 16, "InsertEquation", .OptionButton5
        OptionButton 57, 140, 146, 16, "InsertExcelTable", .OptionButton6
    OKButton 47, 186, 88, 21
    CancelButton 162, 186, 88, 21
End Dialog Dim dlg As UserDialog On Error Goto bye Dialog dlg choice = dlg.optiongroup1 Select Case choice
  Case 0
   InsertSound
  Case 1
   InsertWordArt
  Case 2
   InsertChart
  Case 3
   InsertDrawing
  Case 4
   InsertEquation
  Case 5
   InsertExcelTable
Case Else End Select bye:
End Sub

Kbcategory: kbusage kbmacro KBSubcategory: kbmacroexample


Additional query words: 6.0 winword word6 6.0a 6.0c 7.0 word95
word7

Keywords : kbmacroexample
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: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.