chrisjako Posted March 7, 2016 Posted March 7, 2016 Can anyone tell me if it is possible to extract student photos from SIMS and save them as their admission number in a separate file for example "002468.jpg" We are about to do new ID cards for all the students and the card processing company are asking me for this info however I have 200 pictures from the photographer who took them
pantscat Posted March 7, 2016 Posted March 7, 2016 I think the lovely chaps at Salamander soft have a utility that'll do that - Free Utilities | SalamanderSoft Limited 2
GeorgeVince Posted March 7, 2016 Posted March 7, 2016 (edited) Hey, I was having the same issue extracting photos from SIMS for warboards. I've written a macro using some VBA to do this but I can explain the jist of it here. Create a new report in SIMS add the field Photo and UPN, filter by the year you need and leave the report template as RTF. Run the report, a word document with a table of UPN and student photos should appear. Here's where the magic happens - save the word file as a web page, this exports all of the images into a separate folder. Next I wrote some VBA to simply rename each image with the UPN number in the cell next to it. Hopefully that makes some sense? I can post the code if that would helpful. Edited March 7, 2016 by GeorgeVince
chrisjako Posted March 7, 2016 Author Posted March 7, 2016 the salamander software worked sweet thanks 1
vikpaw Posted March 7, 2016 Posted March 7, 2016 Hey, I was having the same issue extracting photos from SIMS for warboards. I've written a macro using some VBA to do this but I can explain the jist of it here. Create a new report in SIMS add the field Photo and UPN, filter by the year you need and leave the report template as RTF. Run the report, a word document with a table of UPN and student photos should appear. Here's where the magic happens - save the word file as a web page, this exports all of the images into a separate folder. Next I wrote some VBA to simply rename each image with the UPN number in the cell next to it. Hopefully that makes some sense? I can post the code if that would helpful. I would go with SalamanderSoft - works a treat. However, please post the code, it could be useful for other similar tasks, where it needs to be renamed to something else, or based on other fields, which might be out of scope for the utility. Plus others can build on your work if they wish. 1
GeorgeVince Posted March 8, 2016 Posted March 8, 2016 (edited) A really rough and ready method, no error handling as I have no idea how to do it in VBA! Public Sub renamePhotos(pathName As String) Dim objApp As New Word.Application Dim oTempWd As Word.Document Set oTempWd = objApp.Documents.Open(pathName) Dim fso As Scripting.FileSystemObject Dim strToSaveAs As String 'Obtain the direct path name, without the filename directPathName = Left(pathName, InStrRev(pathName, "\")) strToSaveAs = directPathName & "WarboardPhotos.html" Set fso = CreateObject("Scripting.Filesystemobject") If fso.FileExists(strToSaveAs) Then MsgBox "File exists" Else 'Save the SIMS export as a HTML file, this produces a HTML file and a folder named xxx_files where the images are kept oTempWd.SaveAs directPathName & "WarboardPhotos.html", FileFormat:= _ wdFormatHTML, LockComments:=False, Password:="", AddToRecentFiles:=True, _ WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _ SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _ False 'Navigate to the xxx_files folder and find the jpg files Dim StrFile As String StrFile = Dir(directPathName & "WarboardPhotos_files\*jpg*") Dim upnNumber As String Dim ctr As Integer ctr = 1 'Loop through the files Do While Len(StrFile) > 0 ctr = ctr + 1 'Obtain the UPN number from the original file, located in the 2nd column upnNumber = oTempWd.Tables(1).Cell(ctr, 2).Range.Text 'Rename file If StrFile <> upnNumber Then Name directPathName & "WarboardPhotos_files\" & StrFile As directPathName & "WarboardPhotos_files\" & Left(upnNumber, 13) & ".jpg" End If ' Next file loop with Dir function StrFile = Dir Loop MsgBox ("Photos Renamed") oTempWd.Close objApp.Quit End If End Sub Edited March 8, 2016 by GeorgeVince 2
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now