PathForPictures Property

Microsoft Publisher Visual Basic

expression.PathForPictures

expression    Required. An expression that returns one of the objects in the Applies To list.

Example

This example sets the path for picture files. (Note that PathToFolder must be replaced with a valid folder path for this example to work.)

Sub SetPicturePath()
    Options.PathForPictures = "PathToFolder"
End Sub
		

This example places the default path for picture files in a string and then uses the path string to add the specified file to the active publication. (Note that Filename must be replaced with a valid file name for this example to work.)

Sub InsertNewPicture()
    Dim strPicPath As String

    strPicPath = Options.PathForPictures

    ActiveDocument.Pages(1).Shapes.AddPicture FileName:=strPicPath _
        & "Filename", LinktoFile:=msoFalse, _
        SaveWithDocument:=msoTrue, Left:=50, Top:=50, Height:=200

End Sub