WD2000: Invalid Anchor Argument Causes IPF with AddPicture Method (204615)
The information in this article applies to:
This article was previously published under Q204615 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
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. MORE INFORMATIONFor 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.
Modification Type: | Major | Last Reviewed: | 12/6/2000 |
---|
Keywords: | kbbug KB204615 |
---|
|