Export (0) Print
Expand All

How to: Resize Bookmark Controls

Note Required applications

The features in this topic are available only if you have the required applications installed.

For more information, see Features Available by Product Combination.

  • One of these development environments:

    VSTO 2005

    -or-

    Visual Studio Team System

  • Microsoft Office 2003

You set the size of a Bookmark control when you add it to a Microsoft Office Word 2003 document; however, you may want to resize it at a later time. Whenever you work with Bookmark controls, you should make sure that they are visible in the document so that you can verify their placement. Bookmarks are visible by default when opening documents within Visual Studio.

There are three ways to resize a bookmark.

  • Add or remove text within the Bookmark control.

    Whenever you type text within a bookmark, the size of the bookmark increases. When you delete text, the size of the bookmark decreases.

  • Change the Start and End properties.

    You can increase or decrease the size of a Bookmark control by changing the Start and End properties of the bookmark. This is useful if you are only changing the size by a few characters.

  • Recreate the bookmark.

    You can recreate the bookmark and reset the size by adding a new bookmark and giving it the same name as the existing bookmark. This is useful if there is a substantial change in the size or location of a bookmark.

NoteNote

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

To set the Start and End properties of a bookmark

  1. Select the bookmark in the Properties window.

  2. Increase or decrease the value in the Start property.

  3. Increase or decrease the value in the End property.

To change the size of bookmark by recreating it

  1. Select the text to be included in the Bookmark control.

  2. Click Insert and select Bookmark.

  3. In the Bookmark dialog box, select the name of the bookmark that you want to resize and click Add.

The following code assumes you have a Bookmark control named SampleBookmark, and that you have at least five characters of text on either side of it.

To resize a bookmark programmatically

  1. Increase the bookmark by five characters from the start:

    this.SampleBookmark.Start = this.SampleBookmark.Start - 5;
    
    
  2. Increase the bookmark by five characters from the end:

    this.SampleBookmark.End = this.SampleBookmark.End + 5;
    
    

See Also

Community Additions

ADD
Show:
© 2014 Microsoft