WD2000: Run Time Error 4605 Accessing PageSetup Object After You Insert Table in Frame (275966)



The information in this article applies to:

  • Microsoft Word 2000

This article was previously published under Q275966

SYMPTOMS

In Microsoft Word 2000, when you run a Microsoft Visual Basic for Applications macro that accesses the PageSetup object from the Document object or the Section object, you receive the following error message:
Run time error '4605'. This command is not available.

CAUSE

This problem can occur if all of the following conditions are true:
  • Your document contains a frame (not to be confused with an HTML frame or a frame page).

    -and-
  • The frame contains a table.

    -and-
  • The frame is anchored to the first paragraph in the document.

    -and-
  • You run a Visual Basic for Applications macro from Word, accessing the PageSetup object from the Document object or the Section object, as in the following example:
    Public Sub TestPgSetup()
    
       MsgBox ActiveDocument.PageSetup.Orientation
       MsgBox ActiveDocument.Sections(1).PageSetup.Orientation
    
    End Sub
    					
NOTE: You do not receive this error message if your frame does not contain a table, if you have a table that is not inside of the frame, or if the frame is anchored to anything other than the first paragraph in the document.

WORKAROUND

To work around this issue, do one of the following:
  • Position the frame so that it is no longer anchored to the first paragraph in the document by dragging it to another location in the document. (The frame is always anchored to the closest paragraph and appears on the same page as the paragraph that it's anchored to.)

    -or-
  • Use a text box instead of a frame, and then insert your table into the text box.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
This problem was corrected in Microsoft Word 2002.

MORE INFORMATION

To insert a frame into your document, follow these steps:
  1. Press ALT+F8 to switch to the Macros window.
  2. Type InsertFrame and then click Run.
  3. Click and drag the mouse in the document to create the frame.

REFERENCES

For additional information about text boxes and frames, click the article number below to view the article in the Microsoft Knowledge Base:

211954 WD2000: General Information About Text Boxes and Frames


Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kbbug kbnofix KB275966