Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

Wie das Thema schon sagt suche ich eine Möglichkeit PDF's mit einer VBA Anwendung anzeigen zu lassen.

Wäre recht wichtig!

Danke

  • Autor

Das Problem ist: In der VBA-Anwendung können momentan schon PDF's geöffnet werden über den Acrobat Reader. Jedoch wenn jemand außerhalb der VBA-Anwendung den Reader öffnet und wieder schließt bekommt die VBA-Anwendung es nicht mehr hin den Reader zu öffnen (nur indem ich die VBA-Anwendung neu starte.

Genau das will ich verhindern.

Gibt es hierfür eine Möglichkeit?

Wie öffnest Du das PDF denn?

Ein Beispiel aus dem Internet.


Public 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

Sub pdf()
Product = "V:\Test.pdf"
ShellExecute 0, "open", Product, "", "", SHOWMAXIMIZED
ShellExecute 0, "print", Product, "", "", SHOWMAXIMIZED
ShellExecute 0, "exit", Product, "", "", SHOWMAXIMIZED
End Sub
[/code]

Frank

Sub werte_aus_acrobat_auslesen() ' Testsub für Zugriff auf Acrobat-Felder

Dim rechnungsname(200) As String

Dim Fld As AFORMAUTLib.field

Dim Flds As AFORMAUTLib.Fields

'Set acrobatx = CreateObject("AcroExch.App")

Set acroexchapp = CreateObject("Acroexch.app")

acroexchapp.CloseAllDocs

Set acroexchavdoc = CreateObject("Acroexch.avdoc")

Summe = 0

Set myOlApp = CreateObject("Outlook.Application")

Set myitem = myOlApp.ActiveInspector.CurrentItem

aufgabe_text = myitem.body

ergebistext = "Rechnung " + Chr(9) + "RG1" + Chr(9) + "RG2" + Chr(9) + "RG3" + Chr(9) + "Verwendet" + Chr(13)

Start = 1

zähler = 1

position_rechnung_beginn = InStr(Start, aufgabe_text, "<", 1)

While position_rechnung_beginn <> 0

position_rechnung_ende = InStr(position_rechnung_beginn, aufgabe_text, ">", 1)

rechnungsname(zähler) = Mid(aufgabe_text, position_rechnung_beginn, position_rechnung_ende - position_rechnung_beginn + 1)

zähler = zähler + 1

Start = position_rechnung_ende

position_rechnung_beginn = InStr(Start, aufgabe_text, "<", 1)

Wend

anzahl_rechnungen = zähler - 1

For i = 1 To anzahl_rechnungen

dateiname = Mid(rechnungsname(i), 2, Len(rechnungsname(i)) - 2)

'If i = 1 Then

' dateiname = "c:\dummy\dummy.pdf"

'ElseIf i = 2 Then

' dateiname = "c:\dummy\dummy1.pdf"

'ElseIf i = 3 Then

' dateiname = "c:\dummy\dummy2.pdf"

'Else

' End

'End If

bOK = acroexchavdoc.Open(dateiname, True)

If (bOK) Then

Set aformaut = CreateObject("AFormAut.App")

Set Flds = aformaut.Fields

End If

ergebistext = ergebistext + dateiname + Chr(9)

For Each Fld In Flds

If Fld.Name = "Betrag_Ueberweisung_1_" Then

ergebistext = ergebistext + Fld.Value + Chr(9)

If Val(Fld.Value) <> 0 Then betrag = Val(Fld.Value)

End If

Next

For Each Fld In Flds

If Fld.Name = "Betrag_Ueberweisung_2_" Then

ergebistext = ergebistext + Fld.Value + Chr(9)

If Val(Fld.Value) <> 0 Then betrag = Val(Fld.Value)

End If

Next

For Each Fld In Flds

If Fld.Name = "Betrag_Ueberweisung_3_" Then

ergebistext = ergebistext + Fld.Value + Chr(9)

If Val(Fld.Value) <> 0 Then betrag = Val(Fld.Value)

End If

Next

Summe = Summe + betrag

ergebistext = ergebistext + Format(betrag, "#####.##") + Chr(13)

acroexchapp.CloseAllDocs

'bOK.CloseAllDocs

Next i

ergebistext = ergebistext + Chr(13) + "Gesamtbetrag: " + Format(Summe, "#####.##")

myitem.body = myitem.body + Chr(13) + Chr(13) + "-----" + ergebistext

MsgBox (ergebistext)

'text = "C:\Programme\Adobe\Acrobat 5.0\Acrobat\acrobat.exe"

'text = text + " " + rechnung

'AnwID = Shell(text, 6)

'Set aktuelle_datei = acrobatx.getactivedoc.getpddoc

'Set outlook_fenster = CreateObject("Outlook.Application").ActiveExplorer

'outlook_fenster.Activate

'MsgBox (aktuelle_datei.getfilename)

'MsgBox (acrobatx.getactivedoc.getpddoc.AcquirePage(1).GetNumAnnots)

'formfieldcount)

End Sub

hoffe du blikst es.....

ps: ist aber als makro geschrieben

gruss türk

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.