Solved

Windows Picture/Fax Viewer-VBA solution & ?

Posted on 2004-08-10
8
1,246 Views
Last Modified: 2008-01-09
The following code accomplishes opening the Windows Picture & Fax Viewer, to a point. Hope part 1 helps someone else:

If UserForm1.OptionButton4.Value = True Then
For k = 0 To 8 Step 1
If ArrayList3(k).Value = True Then
Set fso = New FileSystemObject
Set objFile = fso.GetFile("" & drive & ":\ClientDocs\" & filename & _
"\" & filename & "" & ArrayList2(k) & "\" & filename & "" _
& ArrayList1(k) & ".jpg")
Shell "rundll32.exe C:\WINNT\System32\shimgvw.dll,ImageView_Fullscreen " & _
"" & objFile & "" '"c:\ClientDocs\AbelDanielle\AbelDanielleDDForm\AbelDanielleDD.jpg"
End If
Next k
End If

The routine loops through finding the auto "checked" .jpg images on file and lo and behold the Viewer opens and flahes through the 4 (in my test case) files...my question is this: after the 4th image appears, the "back" arrow does not bring up image 3,2 or 1...how do I get the viewer to remember the 1st three images? Would this be done via an array of some type? Hey, at least I got this far!

Thanks,
Ron
0
Comment
Question by:ronaldj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 7

Accepted Solution

by:
jacobhoover earned 100 total points
ID: 11768627
All teh images are located in a different directory.. So I belive you are out of luck with this approach.  I belive the viewer is just showing you the current objects in the folder it can understand.  I think you would have to copy the images to a temp directory for browsing, if you are required to use the MS Viewer.  You could also just use an Image or Picture control to display the pictures on your own form.  Then you could just have an array of file names w/ complete paths and an index to hold the current location with 2 command buttons for next and previous.
0
 

Author Comment

by:ronaldj
ID: 11768689
Basically agree, maybe this is even simpler. Here's what I did: with OptionButton4=true, Delete files routine (& KillProperly) are run to empty the content of c:\DocView...

If UserForm1.OptionButton4.Value = True Then
Sub DeleteFiles()
' DeleteFiles Macro
' Macro recorded 8/10/2004 by ronald j. usauskas
'Loop through all the files in the directory by using Dir$ function
Dim MyDKFile As String
MyDKFile = Dir$("c:\DocView\*.*")
Do While MyDKFile <> ""
    KillProperly "c:\DocView\" & MyDKFile
    'need to specify full path again because a file was deleted 1
    MyDKFile = Dir$("c:\DocView\*.*")
Loop
End Sub

Public Sub KillProperly(Killfile As String)
    If Len(Dir$(Killfile)) > 0 Then
        SetAttr Killfile, vbNormal
        Kill Killfile
    End If
End Sub
'******************************************
now, with the CopyFile included and the reference to C:\DocView, works just great!

For k = 0 To 8 Step 1
If ArrayList3(k).Value = True Then
Set fso = New FileSystemObject
Set objFile = fso.GetFile("" & drive & ":\ClientDocs\" & filename & _
   "\" & filename & "" & ArrayList2(k) & "\" & filename & "" _
   & ArrayList1(k) & ".jpg")
fso.CopyFile "" & objFile & "", "c:\DocView\"
End If
Next k
UserForm1.Hide
Shell "rundll32.exe C:\WINNT\System32\shimgvw.dll,ImageView_Fullscreen " & _
"c:\DocView"
0
 
LVL 7

Expert Comment

by:jacobhoover
ID: 11768712
Any further questions?
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

Author Comment

by:ronaldj
ID: 11768757
Kinda think I answered my own question didn't I.
0
 
LVL 7

Expert Comment

by:jacobhoover
ID: 11768771
Actually, I gave you two suggestions as you had not well defined what exactly the requirement was and then you made the decision as to which of the two choices you prefered and went with it.  No arguments, but you application is now working as I stated it would. =/
0
 

Author Comment

by:ronaldj
ID: 11768886
I really do appreciate your input. The solution I came up with was about an hour after I posted my original query. Yes, you gave me 2 suggestions but the "deed" was already done. I think this is verified by your suggestion vs my response(in code) time. Heck, if could program that quick (or type for that matter) I wouldn't need to be on this board! I think you deserve something for your interest and response...I'm new to this, how do I give you "something" of the 250 points?
0
 
LVL 7

Expert Comment

by:jacobhoover
ID: 11777334
I would agree to a reduced number of points.  The issue is is that I saw a question and I responded to it.  If in further instances you solve you own question, you have to come out here and cancel it or you are committed into responding.  As far as reducing the points, I am not sure but you could always post a request for the reduced value and let it sit untill it goes "stale"
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question