May 1st, 2006, 10:35 AM
#1
Thread Starter
New Member
Fehlermeldung generieren, wenn PDf Suffix nicht verknüpft ist
Hallo zusammen,
wir Ihr sehr schnell festellen werdet bin ich absoluter newbie in VB. Daher habe ich folgendes mittelschweres Problem:
Ich will aus Flash ein PDF Dokument öffnen - dafür (lange Geschichte) benötige ich eine .exe, die mir erlaubt über ein Textfile einen Pfad anzugeben in dem das PDF liegt und diese zu öffnen.
Das funktioniert soweit gut - aber wenn nun jemand keinen Viewer installiert hat pasiert nach dem Klick auf den Link in Flash (also dem Ausführen der .exe) garnichts.
Ich benötige also einen Schnippsel Code, der mir erlaub in dann eine Fehlermeldung auszugeben, die bestenfalls auch noch einen Link auf dei Acrobat Webseite erlaubt ...
Die Open Source zum Öffnen der PDFs folgt:
flash.vbp
Form=..\..\ADMINI~1\DESKTOP\Form2.frm
Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0; comdlg32.ocx
Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.0#0; TABCTL32.OCX
Object={3B7C8863-D78F-101B-B9B5-04021C009402}#1.0#0; RICHTX32.OCX
Object={6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0; comctl32.ocx
Object={FAEEE763-117E-101B-8933-08002B2F4F5A}#1.0#0; DBLIST32.OCX
Object={00028C01-0000-0000-0000-000000000046}#1.0#0; DBGRID32.OCX
Reference=*\G{BEF6E001-A874-101A-8BBA-00AA00300CAB}#2.0#0#C:\WINNT\System32\olepro32.dll#Standard OLE Types
Reference=*\G{00025E01-0000-0000-C000-000000000046}#3.0#0#C:\Program Files\Common Files\Microsoft Shared\DC:\Program Fil#Microsoft DAO 3.0 Object Library
ProjWinSize=82,830,194,128
ProjWinShow=2
IconForm="Form1"
ExeName32="flash.exe"
Name="Project1"
HelpContextID="0"
StartMode=0
VersionCompatible32="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
und Form2.frm
VERSION 4.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 8460
ClientLeft = 1140
ClientTop = 1515
ClientWidth = 6690
Height = 8865
Left = 1080
LinkTopic = "Form1"
ScaleHeight = 8460
ScaleWidth = 6690
Top = 1170
Width = 6810
End
Attribute VB_Name = "Form1"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
#If Win32 Then
Private Declare Function ShellExecute Lib _
"shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
#Else
Private Declare Function ShellExecute Lib _
"shell.dll" Alias "ShellExecute" _
(ByVal hwnd As Integer, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Integer) As Integer
#End If
Private Const SW_SHOWNORMAL = 1
Private Sub Command1_Click()
Call ShellExecute(hwnd, "Open", "design.pdf", "", App.Path, 1)
End Sub
Private Sub Form_Load()
'Fill in the appropriate directory and filename below.
'If the file is in the same directory, simply place the filename in the quotes.
Call ShellExecute(hwnd, "Open", "INSERT FILE NAME HERE", "", App.Path, 1)
Unload Me
End
End Sub
Bitte helft mir wenn möglich mit ein paar Zeilen Code aus der Patsche ...
Vielen Dank im Voraus!
Stephan
Attached Files
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width