Syntax
Picture HorizPos, VertPos, Width, Height, PictureName$, Type, .Identifier
Remarks
Displays a graphic in a custom dialog box. Word automatically sizes the graphic to fit within the Width and Height you have specified.
Argument | Explanation |
HorizPos, VertPos | The horizontal and vertical distance of the upper-left corner of the rectangle containing the graphic from the upper-left corner of the dialog box, in increments of 1/8 and 1/12 of the System font (Windows) or the dialog font (Macintosh). |
Width, Height | The width and height of the rectangle, in increments of 1/8 and 1/12 of the System font (Windows) or the dialog font (Macintosh). |
PictureName$ | The name of the graphics file, AutoText entry, or bookmark containing the graphic that is initially displayed. You can reset PictureName$ with DlgSetPicture in a dialog function when the dialog box is displayed. |
Argument | Explanation |
Type | A value indicating how the graphic is stored: 0 (zero) PictureName$ is a graphics file. Paths are allowed. 1 PictureName$ is an AutoText entry. The AutoText entry must contain a single graphic only (no text or paragraph marks) and must be stored either in the Normal template or the template attached to the active document. 2 PictureName$ is a bookmark in the active document. The bookmark must mark a single graphic only (no text or paragraph marks). 3 PictureName$ is ignored and the graphic is retrieved from the Clipboard. Include empty quotation marks ("") in place of PictureName$. The Clipboard must contain a single graphic only. If the Clipboard contains any text from a Word document, the Microsoft Word icon is displayed in the dialog box. 4 PictureName$ is a PICT file stored in the resource fork of the template containing the macro (Macintosh only). You can use the ResEdit program to add PICT files to the resource fork of a template. |
.Identifier | An identifier used by statements in a dialog function that act on the graphic. For example, you can use this identifier with DlgSetPicture to display a different graphic. |
Note
If the specified picture does not exist, Word displays the text "(missing picture)" within the rectangle that defines the picture area. You can change this behavior by adding 16 to the value for Type. If Type is 16, 17, 18, or 19 and the specified picture does not exist, Word displays an error (which may be trapped with On Error) and displays neither the text "(missing picture)" nor a rectangle in the dialog box.
Example
This example defines a square area at the upper-left corner of the dialog box and inserts the graphic stored in the AutoText entry "Smiley." The dialog box control is identified as .Graphic. For an example of a complete dialog box definition, see Begin Dialog¼End Dialog.
Picture 7, 7, 50, 50, "Smiley", 1, .Graphic
See Also
DlgSetPicture