+ Reply to Thread
Results 1 to 8 of 8

Help with Acrobat.AVDoc

  1. #1
    Registered User
    Join Date
    03-22-2014
    Location
    georgia, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Help with Acrobat.AVDoc

    I have been able to read/write to a PDF using VBA from Excel but I am unable to save or exit the active PDF doc?

    I finish the code with:
    Acrobat.AVDoc (name).Exit, but it stays open and does not save?

    Should I be using PDDoc instead of AVDoc or both?

    I am new to both this forum and vba so forgive me if I am in the wrong place.
    Last edited by jbum; 03-22-2014 at 09:33 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,539

    Re: Help with AVDoc

    I didn't even know you could use VBA with Adobe Acrobat files.

    Suggest you Google: excel vba adobe acrobat. A lot of stuff comes up but I don't know what is relevant to your scenario.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    03-22-2014
    Location
    georgia, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Help with AVDoc

    I may not be asking the question right please forgive me if that is the case. here is the code I am using.

    Sub WriteToAdobeFields()

    Dim AcrobatApplication As Acrobat.CAcroApp
    Dim AcrobatDocument As Acrobat.CAcroAVDoc
    Dim fcount As Long
    Dim sFieldName As String
    Set AcrobatApplication = CreateObject("AcroExch.App")
    Set AcrobatDocument = CreateObject("AcroExch.AVDoc")

    If AcrobatDocument.Open("C:\Documents and Settings\Owner\Desktop\Ticket1.pdf", "") Then
    AcrobatApplication.Show
    Set AcroForm = CreateObject("AFormAut.App")
    Set Fields = AcroForm.Fields
    fcount = Fields.Count
    Fields("Contact Name").Value = "Mr Customer6897687979679!!!"
    Fields("Cust Training").Value = "No"
    Fields("Tech Name").Value = "Name"

    Else: MsgBox "failure"
    End If

    ' -------------------------------------------- This seems to do nothing
    ' -------------------------------------------- If I AcrobatApplication.Close it gives me a left side function error
    AcrobatApplication.Exit
    Set AcrobatApplication = Nothing
    Set AcrobatDocument = Nothing
    Set Field = Nothing
    Set Fields = Nothing
    Set AcroForm = Nothing

    End Sub

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Help with AVDoc

    Have you tried Quit instead of Exit?

    Also, have you tried Close with the document?
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    03-22-2014
    Location
    georgia, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Help with AVDoc

    Quote Originally Posted by Norie View Post
    Have you tried Quit instead of Exit?

    Also, have you tried Close with the document?
    Yes If I use AcrobatApplication.Close it gives me a left side function error.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Help with Acrobat.AVDoc

    Close with the document, not the application.

  7. #7
    Registered User
    Join Date
    03-22-2014
    Location
    georgia, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Help with Acrobat.AVDoc

    Quote Originally Posted by Norie View Post
    Close with the document, not the application.

    Thanks yes I can get it to close, now to get is to save the changes?
    Last edited by jbum; 03-22-2014 at 10:49 AM.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Help with Acrobat.AVDoc

    Here's a crazy idea, try Save.

    PS Here's a couple of links you might find useful.

    http://www.khk.net/wordpress/2009/03...-introduction/

    http://livedocs.adobe.com/acrobat_sd...yer/PDDoc.html

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1