WorksheetBase.SetBackgroundPicture (Método)
Establece el gráfico de fondo de la hoja de cálculo.
Espacio de nombres: Microsoft.Office.Tools.Excel
Ensamblado: Microsoft.Office.Tools.Excel.v4.0.Utilities (en Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)
Sintaxis
'Declaración
Public Sub SetBackgroundPicture ( _
filename As String _
)
public void SetBackgroundPicture(
string filename
)
Parámetros
- filename
Tipo: System.String
Nombre del archivo gráfico.
Ejemplos
El ejemplo de código siguiente utiliza el método SetBackgroundPicture para establecer la imagen de fondo de la hoja de cálculo en un archivo denominado image1.jpg.
Se trata de un ejemplo para una personalización en el nivel del documento.
Private Sub SetWorksheetPicture()
Dim backgroundFilePath As String = "C:\image1.jpg"
If System.IO.File.Exists(backgroundFilePath) Then
Me.SetBackgroundPicture("C:\image1.jpg")
Else
MsgBox("The file C:\image1.jpg does not exist.")
End If
End Sub
private void SetWorksheetPicture()
{
string backgroundFilePath = @"C:\image1.jpg";
if (System.IO.File.Exists(backgroundFilePath))
{
this.SetBackgroundPicture(@"C:\image1.jpg");
}
else
{
MessageBox.Show(@"The file C:\image1.jpg does not exist.");
}
}
Seguridad de .NET Framework
- Plena confianza para el llamador inmediato. Un código de confianza parcial no puede utilizar este miembro. Para obtener más información, vea Utilizar bibliotecas de código que no es de plena confianza.