Hyperlink to a scanned document

G

George R

My hyperlink control will not open a picture file.
The picture file is opened by MS Picture Manager when the file name is
double clicked in windows explorer but when the hyperlink with the correct
path is clicked the picture manager opens with a message that there are no
pictures in the selected locations. It all works fine for a WORD or rtf file
but not for jpeg, bmp or gif files.
Would appreciate knowing how to fix this. I have many scanned documents
needing to be linked, one to each record in the Db.
Thanks you for your consideration.
 
J

Jeanette Cunningham

George,
I tried this and I couldn't even get the full correct path for a picture
into the field in a table by using insert hyperlink.
Same thing happened when I tried to insert the hyperlink into a label on a
form.

Here is a link to a sample database that stores images
http://www.datastrat.com/DataStrat2.html

The sample is called
PictureMgr2K


Here is some code that is used to store an image name and the path to the
image in a database.

Dim Filename As String, Pathname As String
Dim db As DAO.Database
On Error GoTo Err_cmdClose_Click
' Directory Name "BAOS
' Database Name "Archives"
' Photos stored in "IDPhotos" as sub-directory of "BAOS"
Set db = CurrentDb
Filename = db.Name
Pathname = Mid(Filename, 1, Len(Filename) - Len(Dir(Filename)))
'set the picture path
If IsNull(Me![txtPhoto]) Then
Me.ImgPhoto.Picture = ""
Else: Me.ImgPhoto.Picture = Pathname & Me.txtPhoto
End If

The pathname construct:
Set db = CurrentDb
Filename = db.Name
Pathname = Mid(Filename, 1, Len(Filename) - Len(Dir(Filename)))
creates a pathname made from the Access application pathname, so it defaults
to the directory where the Access app is stored. Instead, substitute
Pathname = "drive:\ ... path to myphotos ...

Jeanette Cunningham
 
G

George R

I found three solutions:
1. Save the scanned document as jpg and uncheck the jpg file type under MS
Office Picture Manager (click tools-file types). This makes Windows Picture
and Fax Viewer the default viewer, and the file is opened when the hyperlink
is clicked. However the quality of the screen view of the document was very
poor as compared to opening it directly from the Win Pix and Fax Viewer. This
solution did not work for tif or gif files.
2. Save the scanned document as htm. This worked very well, opening the
document as a webpage.
3. Save the scanned document as rtf. This worked as well as htm but the
saved file size is about 1000 times the htm file size for the same document.
The file is opened in MS WORD.

My thanks to both of you for the suggestions

Jeanette Cunningham said:
George,
I tried this and I couldn't even get the full correct path for a picture
into the field in a table by using insert hyperlink.
Same thing happened when I tried to insert the hyperlink into a label on a
form.

Here is a link to a sample database that stores images
http://www.datastrat.com/DataStrat2.html

The sample is called
PictureMgr2K


Here is some code that is used to store an image name and the path to the
image in a database.

Dim Filename As String, Pathname As String
Dim db As DAO.Database
On Error GoTo Err_cmdClose_Click
' Directory Name "BAOS
' Database Name "Archives"
' Photos stored in "IDPhotos" as sub-directory of "BAOS"
Set db = CurrentDb
Filename = db.Name
Pathname = Mid(Filename, 1, Len(Filename) - Len(Dir(Filename)))
'set the picture path
If IsNull(Me![txtPhoto]) Then
Me.ImgPhoto.Picture = ""
Else: Me.ImgPhoto.Picture = Pathname & Me.txtPhoto
End If

The pathname construct:
Set db = CurrentDb
Filename = db.Name
Pathname = Mid(Filename, 1, Len(Filename) - Len(Dir(Filename)))
creates a pathname made from the Access application pathname, so it defaults
to the directory where the Access app is stored. Instead, substitute
Pathname = "drive:\ ... path to myphotos ...

Jeanette Cunningham

George R said:
My hyperlink control will not open a picture file.
The picture file is opened by MS Picture Manager when the file name is
double clicked in windows explorer but when the hyperlink with the correct
path is clicked the picture manager opens with a message that there are
no
pictures in the selected locations. It all works fine for a WORD or rtf
file
but not for jpeg, bmp or gif files.
Would appreciate knowing how to fix this. I have many scanned documents
needing to be linked, one to each record in the Db.
Thanks you for your consideration.
 
G

George R

I forgot about the supporting files for an htm file. When I add their size on
disk the rtf approach is using about twice as much as the htm approach, not
ten times. A two page document used 1.3 MB as an rtf file and 700 KB as an
htm with supporting folder and files.

George R said:
I found three solutions:
1. Save the scanned document as jpg and uncheck the jpg file type under MS
Office Picture Manager (click tools-file types). This makes Windows Picture
and Fax Viewer the default viewer, and the file is opened when the hyperlink
is clicked. However the quality of the screen view of the document was very
poor as compared to opening it directly from the Win Pix and Fax Viewer. This
solution did not work for tif or gif files.
2. Save the scanned document as htm. This worked very well, opening the
document as a webpage.
3. Save the scanned document as rtf. This worked as well as htm but the
saved file size is about 1000 times the htm file size for the same document.
The file is opened in MS WORD.

My thanks to both of you for the suggestions

Jeanette Cunningham said:
George,
I tried this and I couldn't even get the full correct path for a picture
into the field in a table by using insert hyperlink.
Same thing happened when I tried to insert the hyperlink into a label on a
form.

Here is a link to a sample database that stores images
http://www.datastrat.com/DataStrat2.html

The sample is called
PictureMgr2K


Here is some code that is used to store an image name and the path to the
image in a database.

Dim Filename As String, Pathname As String
Dim db As DAO.Database
On Error GoTo Err_cmdClose_Click
' Directory Name "BAOS
' Database Name "Archives"
' Photos stored in "IDPhotos" as sub-directory of "BAOS"
Set db = CurrentDb
Filename = db.Name
Pathname = Mid(Filename, 1, Len(Filename) - Len(Dir(Filename)))
'set the picture path
If IsNull(Me![txtPhoto]) Then
Me.ImgPhoto.Picture = ""
Else: Me.ImgPhoto.Picture = Pathname & Me.txtPhoto
End If

The pathname construct:
Set db = CurrentDb
Filename = db.Name
Pathname = Mid(Filename, 1, Len(Filename) - Len(Dir(Filename)))
creates a pathname made from the Access application pathname, so it defaults
to the directory where the Access app is stored. Instead, substitute
Pathname = "drive:\ ... path to myphotos ...

Jeanette Cunningham

George R said:
My hyperlink control will not open a picture file.
The picture file is opened by MS Picture Manager when the file name is
double clicked in windows explorer but when the hyperlink with the correct
path is clicked the picture manager opens with a message that there are
no
pictures in the selected locations. It all works fine for a WORD or rtf
file
but not for jpeg, bmp or gif files.
Would appreciate knowing how to fix this. I have many scanned documents
needing to be linked, one to each record in the Db.
Thanks you for your consideration.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top