Save jpg as

brharrii

Registered User.
Local time
Yesterday, 20:32
Joined
May 15, 2012
Messages
272
Access 2010:

The database I'm working on stores label images, or better stated, it stores file paths where the label images are stored. These paths are used in reports and forms to view the label images within the database. What I'd like to do is to create a "save" or "email" button that will allow the user to select a location to save just a copy of the image in jpg format. I realize that it is possible to imbed the jpg image into a report and export it as a pdf. What I'd really like to do is find a way to save the image (perhaps by copying it from the path in the database and simply relocating it) and preserve the jpg extension if that is possible.

I am also aware that there are third party applications that will convert pdf reports into jpg files however network restrictions keep me pretty limited in my ability to download third party software.

Thank you for your thoughts,

Bruce
 
The following pseudo code might do the trick. Place code in a subroutine or function, and call it from the button click event:
Code:
    Dim aFSO As Variant
    Dim strFileNameAndPath As String
    Dim strFileNameOnly As String
    Dim strNewFilePath as String
    
    Set aFSO = CreateObject("Scripting.FileSystemObject")
    ' Store known location of image file to variable
    strFileNameAndPath = [FieldInTableWithFileNameAndPath]
    
    ' Store only the file name to variable
    strFileNameOnly = ' Use the InStrRev function to get file name
    
    ' Prompt user to choose a folder to where the image will be copied
    ' Save chosen path
    strNewFilePath = some function that displays standard Windows folder chooser
    
    aFSO.CopyFile strFileNameAndPath, strNewFilePath & "\" & strFileNameOnly
 
Hi !
@mrojas showed you how to copy a file.
OK. But, forgive me, I can't understand why to do this ?
In order to copy this files, you should have the originals.
My question is: Why to duplicate this originals ?

Is something that you don't said us or I misunderstanding something ?
Can you explain what you have and what you wish to obtain ?
 

Users who are viewing this thread

Back
Top Bottom