Hi Nathan,
for creating x dots from x jpgs,
where all jpgs are in the same folder,
and all the dots in another folder:
Sub Test0796()
Dim sPth As String ' Source Path
Dim tPth As String ' Target Path
Dim sFil As String ' Source File
Dim tFil As String ' Target File
sPth = "c:\test\jpg\"
tPth = "c:\test\dot\"
sFil = Dir(sPth & "*.jpg", vbNormal)
While sFil <> ""
tFil = sFil
tFil = left(tFil, Len(tFil) - 3)
tFil = tFil & "dot"
With ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary)
.Shapes.AddPicture _
FileName:=sPth & sFil, _
LinkToFile:=False, _
SaveWithDocument:=True
End With
ActiveDocument.SaveAs tPth & tFil
sFil = Dir
Wend
End Sub
If you know how to size the background image
that would be great also.
Sizing is not a problem, but to what values?
Like, add these lines:
.Shapes(1).LockAspectRatio = msoFalse
.Shapes(1).Height = CentimetersToPoints(25)
' etc
Analyzing the jpg beforehand
and acting according to the results
would be a not too small project, if possible at all.
If the picture is too small, how to enlarge?
What about distortion? etc....
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"