Solved

Windows Picture/Fax Viewer-VBA solution & ?

Posted on 2004-08-10
8
1,244 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
  • 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
Independent Software Vendors: 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!

 

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Modify a small python script 19 121
iSeries email authority 6 87
Selenium docs api java index 3 64
batch file or script 4 47
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

685 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