WD: WordBasic Examples: Insert Commands

ID: Q106199

The information in this article applies to:

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.

MORE INFORMATION

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

Additional query words:

Keywords          : wordnt kbmacroexample winword ntword word6 winword2 word7 word95 word 
Version           : 6.0 6.0a 6.0c 7.0 7.0a
Platform          : WINDOWS
Issue type        : kbinfo

Last Reviewed: June 11, 1998