WIA rotation can be done like this
Code:
Sub RotateImage(inputPath As String, outputPath As String, angle As Long)
With CreateObject("WIA.ImageProcess")
Dim img As Object
Set img = CreateObject("WIA.ImageFile")
img.LoadFile inputPath
.Filters.Add .FilterInfos("RotateFlip").FilterID
.Filters(1).Properties("RotationAngle") = angle
Set img = .Apply(img)
img.SaveFile outputPath
End With
End Sub
You basically process the image by adding filters to the filters collection and then you apply them.
Check out: https://learn.microsoft.com/en-us/previous-versions/windows/desktop/wiaaut/-wiaaut-howto-use-filters#rotateflip-filter-rotate-a-picture
WIA is limited, but it gets the job done.
If you want to have more image capabilities, there are some nice utilities out there, like ImageMagick. To use that, you could do this AFTER INSTALLING IT:
Code:
Sub RotateImage(inputPath As String, outputPath As String, angle As Long)
Dim magick As String
magick = CreateObject("WScript.Shell").Exec("cmd /c where magick").StdOut.ReadLine
Shell magick & " " & inputPath & " -rotate 90 " & outputPath
End Sub
It's fewer lines of code and it has way more features. Check it out here: https://imagemagick.org/index.php
You asked for rotation for a report and jojowhite made a nice database for that.
I have a little sample that does the image rotation in real time in forms, not in reports, just in case some passerby wants to check it out as well. It uses the browser control.