WD2000: Invalid Anchor Argument Causes IPF with AddPicture Method

ID: Q204615


The information in this article applies to:
  • Microsoft Word 2000


SYMPTOMS

When you use the Visual Basic for Applications AddPicture method, the following error message appears:

This program has performed an illegal operation and will be shut down.
If the problem persists, contact the program vendor.
When you click Details, the following message is displayed:
WINWORD caused an invalid page fault in module WINWORD.EXE at 015f:30612f3a

NOTE: The actual memory address may vary.


CAUSE

The problem is caused by using an invalid value for the Anchor argument of the AddPicture method.


RESOLUTION

To resolve this problem, edit the command line to use a valid argument for the Anchor argument, as in the following example:


Sub AddShapeExample()
   If Documents.Count > 0 Then
      With ActiveDocument.Shapes
         .AddPicture FileName: = "c:\windows\Blue Rivets.bmp", _
            Anchor: = Selection.Range
      End With
   End If
End Sub 


STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

For more information about the AddPicture Method, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type "AddPicture Method" in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Additional query words: vba

Keywords : kbdta kbwordvba wd2000
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: May 13, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.