Sub
book()
Dim
Exch
As
Object
Dim
AVDocu
As
Object
Dim
AVPageView
As
Object
Dim
PDDocu
As
Object
Dim
PDPage
As
Object
Dim
PDText
As
Object
Dim
strArgument2
As
String
Dim
PDBookmark
As
Object
Dim
numPages
As
Integer
Dim
bFile
As
Boolean
Dim
bShow
As
Boolean
Dim
iPageNumber
As
Integer
Dim
ii
As
Long
, jj
As
Long
, iii
As
Long
Set
Exch = CreateObject(
"AcroExch.App"
)
Set
AVDocu = CreateObject(
"AcroExch.AVDoc"
)
Set
PDDocu = CreateObject(
"AcroExch.PDDoc"
)
strArgument2 = (
"\\ERPA-SERVER\ERPA-Updates\ERPA-Standards\KatalogDE\Erpa_Katalog_DE.pdf"
)
AVDocu.Open strArgument2, strArgument2
Debug.Print bShow
bShow = Exch.Show()
Debug.Print bShow
Set
PDDocu = AVDocu.GetPDDoc
numPages = PDDocu.GetNumPages()
Debug.Print numPages
Set
AVPageView = AVDocu.GetAVPageView
Dim
bookmarkstr(1000)
As
String
Dim
JSO
As
Boolean
Dim
jsoo
As
Object
Dim
gPdDoc
As
Acrobat.CAcroPDDoc
Dim
indexB
As
Integer
indexB = 0
Dim
indexC
As
Integer
indexC = 0
For
ii = 0
To
500
If
ii = 0
Then
GoTo
hier
If
Cells(ii, 4).Value =
"standard"
Or
Cells(ii, 4).Value =
"alias"
Then
bookmarkstr(indexB) = Range(
"G"
& indexC)
bookmarkstr(indexB + 1) = Range(
"G"
& indexC) &
"_2"
End
If
hier:
indexB = indexB + 2
indexC = indexC + 1
Next
ii
Dim
strTempArray()
As
String
Dim
j
As
Integer
Dim
i
As
Integer
For
i = 0
To
UBound(bookmarkstr)
If
bookmarkstr(i) <>
""
Then
ReDim
Preserve
strTempArray(j)
strTempArray(j) = bookmarkstr(i)
j = j + 1
End
If
Next
For
iii = 0
To
numPages - 1
JSO = AVDocu.GetAVPageView.Goto(iii)
Set
PDBookmark = CreateObject(
"AcroExch.PDBookmark"
,
""
)
Exch.MenuItemExecute (
"NewBookmark"
)
JSO = PDBookmark.GetByTitle(PDDocu,
"Unbenannt"
)
JSO = PDBookmark.SetTitle(strTempArray(iii))
JSO = PDDocu.Save(PDSaveFull, strArgument2)
Next
iii
Exch.MenuItemExecute (
"Save"
)
PDDocu.Close
AVDocu.Close (0)
Exch.
Exit
Set
Exch =
Nothing
Set
PDDocu =
Nothing
Set
AVDocu =
Nothing
End
Sub