Sub test()
Dim Rng As Range, shap1, shap2, mongroupe
Set Rng = Range(ActiveSheet.PageSetup.PrintArea)
Set shap1 = ActiveSheet.Shapes.AddShape(1, 0, 0, Rng.Height, Rng.Width)
With shap1
.Fill.ForeColor.RGB = vbWhite
.Line.Transparency = 1
End With
ActiveSheet.Shapes.AddTextEffect(msoTextEffect1, " ceci est un filigrane ", _
"algerian", 14#, msoTrue, msoFalse, 0, Rng.Height / 2).Select
With Selection
Set shap2 = .ShapeRange
.Width = Rng.Height
.ShapeRange.TextEffect.PresetShape = msoTextEffectShapePlainText
.ShapeRange.Fill.Transparency = 1
.ShapeRange.Line.Weight = 0
.ShapeRange.Line.Transparency = 1
.ShapeRange.IncrementRotation -40#
End With
With ActiveSheet
Set mongroupe = .Shapes.Range(Array(shap1.Name, shap2.Name))
mongroupe.Group
mongroupe.Name = "fili"
With .Shapes("fili"): .CopyPicture: .Delete: End With
With ActiveSheet.ChartObjects.Add(0, 0, _
Rng.Width, Rng.Height).Chart
Do: .Paste: DoEvents: Loop While TypeName(Selection) = "Range" 'en attente du collage
.Export Environ("userprofile") & "\DeskTop\fili.jpg", "jpg" 'ici je souhaiterais que la boite de dialogue s'ouvre pour me demander ou enregistrer l'image...
.Parent.Delete
End With
End With
End Sub