T
teddy b via OfficeKB.com
Need help.
My image will call out from excel file then post it to the header of document.
The image is sit inside header Frame and table.
How to wrap it using vba? I'm trying Application.Options.PrintDrawingObjects
= False but not working. It's work only after i wrap it manualy on the image.
Below is my script:
With wb.Sheets(2)
LastRow = .Range("A65536").End(xlUp).Row
For z = 2 To LastRow
If (.Range("A" & z).Text) = "1" Then
'Check Image
If Len(Dir("C:\" & (.Range("A" & z).Text))) > 0 Then
FName = (.Range("A & z).Text)
With ActiveDocument.Sections(1).Headers
(wdHeaderFooterFirstPage).Range.Tables(1).Cell(1, 1).Range
.Delete
.InlineShapes.AddPicture FileName:="C:\" & FName,
LinkToFile:=False
End With
End If
End If
Next z
End With
Thanks.
Regards,
teddy
My image will call out from excel file then post it to the header of document.
The image is sit inside header Frame and table.
How to wrap it using vba? I'm trying Application.Options.PrintDrawingObjects
= False but not working. It's work only after i wrap it manualy on the image.
Below is my script:
With wb.Sheets(2)
LastRow = .Range("A65536").End(xlUp).Row
For z = 2 To LastRow
If (.Range("A" & z).Text) = "1" Then
'Check Image
If Len(Dir("C:\" & (.Range("A" & z).Text))) > 0 Then
FName = (.Range("A & z).Text)
With ActiveDocument.Sections(1).Headers
(wdHeaderFooterFirstPage).Range.Tables(1).Cell(1, 1).Range
.Delete
.InlineShapes.AddPicture FileName:="C:\" & FName,
LinkToFile:=False
End With
End If
End If
Next z
End With
Thanks.
Regards,
teddy