PictureFormat.Replace Method
Publisher Developer Reference |
Replaces the specified picture. Returns Nothing.
Syntax
expression.Replace(Pathname, InsertAs)
expression A variable that represents a PictureFormat object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Pathname | Required | String | The name and path of the file with which you want to replace the specified picture. |
InsertAs | Optional | PbPictureInsertAs | The manner in which you want the picture file inserted into the document: linked or embedded. |
Remarks
Use the Replace method to update linked picture files that have been modified since they were inserted into the document. Use the LinkedFileStatus property of the PictureFormat object to determine if a linked picture has been modified.
The InsertAs parameter can be one of the following PbPictureInsertAs constants declared in the Microsoft Office Publisher type library. the default value is pbPictureInsertAsOriginalState.
pbPictureInsertAsEmbedded |
pbPictureInsertAsLinked |
pbPictureInsertAsOriginalState |
Example
The following example replaces every occurrence of a specific picture in the active publication with another picture.
Visual Basic for Applications |
---|
|
This example tests each linked picture to determine if the linked file has been modified since it was inserted into the publication. If it has, the picture is updated by replacing the file with itself.
Visual Basic for Applications |
---|
|
See Also