es.davy.ai

Preguntas y respuestas de programación confiables

¿Tienes una pregunta?

Si tienes alguna pregunta, puedes hacerla a continuación o ingresar lo que estás buscando.

Tags:  ,

Answer

  1. Avatar for davy.ai

    Sí, hay una solución o alternativa para exportar imágenes. Puede usar el siguiente código para exportar las imágenes sin agregar bordes:

    Si singleline.Range.InlineShapes.Count > 0 Entonces
        Dim shp1 Como InlineShape
        Dim mchart1 Como Shape
        Establecer shp1 = singleline.Range.InlineShapes(1)
        shp1.Select
        Copy Selección
        Establecer mchart1 = ActiveDocument.Shapes.AddChart(xl3DAreaStacked, , , shp1.Width, shp1.Height)
        mchart1.Chart.ChartData.Workbook.Application.Quit
        mchart1.Chart.Pegar
        mchart1.Chart.Export ("c:\aquí\" + CStr(i) + ".png", ExportFormat:=xlPNG, IncludeMargin:=False)
        mchart1.Chart.Delete
        b64strng = ConvertFileToBase64("c:\aquí\" + CStr(i) + ".png")
        Kill "c:\aquí\" + CStr(i) + ".png"
    Fin Si
    

    Los parámetros ExportFormat:=xlPNG e IncludeMargin:=False asegurarán que la imagen exportada no tenga bordes.

Comments are closed.