
Macro Word Shapes.AddCanvas
Publicado por Rodolfo (2 intervenciones) el 18/01/2023 03:41:46
Buenas, tengo una duda con una macro, estoy insertando imagenes en todas las hojas de un documento, todo sin problema, el detalle es cuando la hoja tiene una tabla muy grande o al inicio del documento, los atributos left y top no me toman del documento si no de la tabla, como puedo hacer para que no haga eso??
la imagen que trato de adjuntar es la firma


la imagen que trato de adjuntar es la firma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
For i = 1 To a
If i = excep Then
With Selection.Find
.Forward = True
.Wrap = wdFindStop
.Text = "Marcelo Martinez"
.Execute
End With
lefs = Selection.Information(wdHorizontalPositionRelativeToPage)
tops = Selection.Information(wdVerticalPositionRelativeToPage)
'Add a drawing canvas to the active document
Set shpCanvas = ActiveDocument.Shapes _
.AddCanvas(Left:=lefs - 40, Top:=tops + 20, _
Width:=190, Height:=80)
'Add a graphic to the drawing canvas
shpCanvas.CanvasItems.AddPicture _
FileName:="E:\firma marcelo vt.png", _
LinkToFile:=False, SaveWithDocument:=True, Width:=190, Height:=80
Else
'Add a drawing canvas to the active document
Set shpCanvas = ActiveDocument.Shapes _
.AddCanvas(Left:=0, Top:=100, _
Width:=80, Height:=190)
'Add a graphic to the drawing canvas
shpCanvas.CanvasItems.AddPicture _
FileName:="E:\firma marcelo hz.png", _
LinkToFile:=False, SaveWithDocument:=True, Width:=80, Height:=190
End If
With shpCanvas.PictureFormat
.TransparentBackground = msoCTrue
End With


Valora esta pregunta


0