-
Word 2016 VBA - Picture Formatting in a Canvas
I am pushing data from an excel spreadsheet into a word template. I have everything working except I cannot format pictures.
Snippet of the code regarding the format below:
Dim REPORTRW
Set wbREMAN = ThisWorkbook
'Set TheSheet = Sheets("Report")
Set wS1 = Sheets("Tool")
Set wS2 = Sheets("Data")
Set wS3 = Sheets("Report")
Set wrdApRPT = CreateObject("Word.Application")
wrdApRPT.Visible = True
Set wrdDocRPT = wrdApRPT.Documents.Add(Template:="C:\Reman\Reman.dotm")
REPORTRW = RemanFORM.SBV1.Value
wS3.Select
Dim rowselect As Double
rowselect = RemanFORM.SBV1.Value
rowselect = rowselect + 0
Rows(rowselect).Select
With wrdDocRPT
Pic1File = Cells(rowselect, 23).Value
Pic2File = Cells(rowselect, 24).Value
.Shapes("Canvas 44").CanvasItems.AddPicture filename:=Pic1File, LinkToFile:=False, SaveWithDocument:=True
With .Shapes("Canvas 44").CanvasItems(1)
.LockAspectRatio = msoCTrue
.Height = InchesToPoints(3.91)
.Width = InchesToPoints(3.7)
With .Borders
.Enable = True
.OutsideColor = wdColorBlack
.OutsideLineStyle = wdLineStyleSingle
.OutsideLineWidth = wdLineWidth300pt
End With
With .Shadow
.Transparency = 0.55
.Size = 100
.Blur = 4
.Angle = 45
.distance = 3
End With
End With
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules