Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).


New Forum | Previous | Next | (P-PDF) Developers


Topic: Supressing error messages
Conf: (P-PDF) Developers, Msg: 109660
From: rpradyumna
Date: 4/15/2004 03:17 PM

hi

i am creating bookmark to a file which is already open. but i am getting an error stating the file could not be opened. the bookmark is still added. i tried to set the flag to supress the error message but if i do it the bookmark title is same for all the bookmarks. is there a way to solve this. i am using VB for this purpose.

thankx in advance
Pradyumna

the code is as below:

Dim objPDDoc_Envelope As Acrobat.CAcroPDDoc
Dim AcrApp As Acrobat.CAcroApp
Dim AcrAVDoc As Acrobat.CAcroAVDoc
Dim AcrBkm As Acrobat.CAcroPDBookmark

Set AcrApp = CreateObject("AcroExch.App")
Set AcrAVDoc = CreateObject("AcroExch.AVDoc")
Set AcrBkm = CreateObject("AcroExch.PDBookmark")
Set objPDDoc_Envelope = CreateObject("AcroExch.PDDoc")

Set AcrAVDoc = AcrApp.GetActiveDoc
Set objPDDoc_Envelope = AcrAVDoc.GetPDDoc

'Supress any adobe error messages
PDDocFlags = objPDDoc_Envelope.SetFlags(PDDocSupressErrors)

'Job Info
AcrAVDoc.FindText "REV ECO# DESCRIPTION DSGNR DATE CHKDBY", True, True, True
AcrApp.MenuItemExecute ("NewBookmark")
AcrBkm.GetByTitle objPDDoc_Envelope, "Untitled"
AcrBkm.SetTitle ("Job Info")

'Point Card/Blade Card
If frmOptions.Option_PointCard.Value = True Then
AcrAVDoc.FindText "Point Card", True, True, True
ElseIf frmOptions.Option_BladeCard.Value = True Then
AcrAVDoc.FindText "Blade Card", True, True, True
End If
AcrApp.MenuItemExecute ("NewBookmark")
AcrBkm.GetByTitle objPDDoc_Envelope, "Untitled"
If frmOptions.Option_PointCard.Value = True Then
AcrBkm.SetTitle ("Point Card")
ElseIf frmOptions.Option_BladeCard.Value = True Then
AcrBkm.SetTitle ("Blade Card")
End If


'Point Card/Blade Card Parts Request Form
If frmOptions.Option_PointCard.Value = True Then
AcrAVDoc.FindText "Parts Request Form", True, True, True
ElseIf frmOptions.Option_BladeCard.Value = True Then
AcrAVDoc.FindText "Blade Card Machine Shop Request Form", True, True, True
End If
AcrApp.MenuItemExecute ("NewBookmark")
AcrBkm.GetByTitle objPDDoc_Envelope, "Untitled"
If frmOptions.Option_PointCard.Value = True Then
AcrBkm.SetTitle ("Parts Request Form")
ElseIf frmOptions.Option_BladeCard.Value = True Then
AcrBkm.SetTitle ("Blade Card Machine Shop Request Form")
End If

'Ring Inspection Drawing
'AcrAVDoc.FindText "INSPECTION", True, True, True
AcrAVDoc.FindText "2of2,", True, True, True
AcrApp.MenuItemExecute ("NewBookmark")
AcrBkm.GetByTitle objPDDoc_Envelope, "Untitled"
AcrBkm.SetTitle ("Ring Inspection Drawing")

'Fixture Inspection Drawing
AcrAVDoc.FindText "2of2.", True, True, True
AcrApp.MenuItemExecute ("NewBookmark")
AcrBkm.GetByTitle objPDDoc_Envelope, "Untitled"
AcrBkm.SetTitle ("Fixture Inspection Drawing")

'Save it
AcrApp.MenuItemExecute ("Save")

'Close the PDF document
' AcrAVDoc.Close (True)
'Close the PDF file reference
' objPDDoc_Envelope.Close
'Close Acrobat
' AcrApp.Exit

Set AcrApp = Nothing
Set objPDDoc_Envelope = Nothing
Unload FrmPrintOptions
Unload frmPopup
MsgBox "PDF generation successful", vbOKOnly + vbInformation
Exit Function

vAddBookMarks2DocError:
Unload frmPopup
MsgBox Err.Number & vbCrLf & Err.Description
MsgBox "Bookmark generation unsuccessful", vbOKOnly + vbExclamation

PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Back to the past, 15 years ago! Open Publish 2002

Looking back to 2002, it's amazing how much of the prediction became a reality. Take a read and see what you think!

September 14, 2017
Platinum Sponsor





Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.

Features

Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.