Article ID: 157773 - Last Review: January 19, 2007 - Revision: 2.3

WD97: Macro to Disable Float Over Text Property

This article was previously published under Q157773

On This Page

Expand all | Collapse all

SYMPTOMS

In Microsoft Word 97, when you insert a picture or an object, by default, the picture or object is inserted as floating object. That is, the Float Over Text check box is always enabled.

In addition, if you click to clear the Float Over Text check box, the check box is reset each time you insert a new picture or object. That is, the setting you choose is not retained. You must clear the check box each time you insert an object or picture.

This article provides a sample Visual Basic for Applications macro that opens the InsertPicture or InsertObject dialog box with the Float Over Text check box deselected.

Note: In Microsoft Word 97 Service Release 1, when you insert a picture or object, it is inserted as an inline (non-floating) object. That is, the Float Over Text check box is cleared by default.

In addition, if you click to select the Float Over Text check box, Word will retain your setting. That is, the option will be set until you change it again.

For additional information, please see the following articles in the Microsoft Knowledge Base:
170564  (http://support.microsoft.com/kb/170564/EN-US/ ) WD97: Pictures and Objects Inserted as Inline by Default in SR-1

WORKAROUND

Microsoft 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 a Microsoft Certified Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites:

Microsoft Certified Partners - https://partner.microsoft.com/global/30000104 (https://partner.microsoft.com/global/30000104)

Microsoft Advisory Services - http://support.microsoft.com/gp/advisoryservice (http://support.microsoft.com/gp/advisoryservice)

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS (http://support.microsoft.com/default.aspx?scid=fh;en-us;cntactms) If you name the following example Visual Basic for Applications macros "InsertPicture" and "InsertObject", Word will run these macros instead of opening the default dialog box when you click From File (On the Insert Picture menu) or when you click Object on the Insert menu. You can use another name and assign the macro(s) to a toolbar button or menu if you want to have access both to Word's built-in dialog box and the one displayed when these macros are run.

Macro workaround for the Insert Picture Dialog Box

   Sub InsertPicture()
      With Dialogs(wdDialogInsertPicture)
         .FloatOverText = False
         .Show
      End With
   End Sub
				

Macro workaround for the Insert Object Dialog Box

   Sub InsertObject()
      ' Turns the float over text option off.
      SendKeys "%{t}"
      ' Displays the Insert Object dialog.
      Dialogs(wdDialogInsertObject).Show
   End Sub
				
For more information about adding a command to a menu, click Contents And Index on the Help menu, click the Index tab in Word Help, type the following text
menus
and then double-click the selected text to go to the "Add a command or other item to a menu" topic. If you are unable to find the information you need, ask the Office Assistant.

MORE INFORMATION

For additional information, please see the following article in the Microsoft Knowledge Base:
181058  (http://support.microsoft.com/kb/181058/EN-US/ ) OFF98: How to Run Sample Code from Knowledge Base Articles

REFERENCES

For more information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base:
163435  (http://support.microsoft.com/kb/163435/EN-US/ ) VBA: Programming Resources for Visual Basic for Applications

APPLIES TO
  • Microsoft Word 97 Standard Edition
Keywords: 
kbdtacode kbmacroexample kbprb kbualink97 KB157773
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
 

Article Translations