Results 1 to 4 of 4

Thread: [Resolved] Experience with Acrobat Add-In and Word CommandBar

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Location
    Rochester, New York
    Posts
    8

    Resolved [Resolved] Experience with Acrobat Add-In and Word CommandBar

    Does anybody have any experience with VBA scrips modifying the Menubar (using the CommandBar functions) and at the same time having the Acrobat 7.x PDFMaker COM Add-In loaded.

    My menus get "screwed" up because of the Adobe COM Add-In, and I can't seem to get any help on the Adobe site.

    I need to develop a stable solutions but at the same time allow for users to have the Adobe system loaded.

    Thanks

    :-)an
    Last edited by pingel; Apr 28th, 2006 at 10:05 AM. Reason: Resolved

  2. #2
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Experience with Acrobat Add-In and Word CommandBar

    Welcome to the forums!

    When you say 'My menus get "screwed" up', what exactly is happening?
    Also, can you post the code you are using to build the menus.

    Giving a detailed explaination of the issues and posting you code will always help you to get a quick response.
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Location
    Rochester, New York
    Posts
    8

    Post Re: Experience with Acrobat Add-In and Word CommandBar

    By "screwed" up I mean that Either my menu in the main menu bar gets the content of one of the Adobe menus ("Adobe PDF" or "Adobe Comments") or the Adobe menus' gets the content of my menu or the Adobe menus become empty.

    My code is very simple:

    ...
    CustomizationContext = Application.ActiveDocument

    Set MainMenuBar = Application.ActiveDocument.CommandBars.ActiveMenuBar
    Set HelpMenu = MainMenuBar.Controls.Item("Help")
    Loc = HelpMenu.Index
    Set TestMenuBar = MainMenuBar.Controls.Add(Type:=msoControlPopup, Before:=Loc, Temporary:=True)
    TestMenuBar.Caption = "Test"
    Set newMenu = TestMenuBar.Controls.Add(Type:=msoControlButton, Temporary:=Temporary)
    newMenu.Caption = "Testing function"
    newMenu.OnAction = "TestFunction"
    ...

    This places a pulldown menu - right before the help menu with the name Test and with one action on the menu called "Testing Function"

    I also have some code to delete the menu before the document is saved:

    ...
    CustomizationContext = Application.ActiveDocument
    If IsEmpty(TestMenuBar) Then
    Set MainMenuBar = Application.ActiveDocument.CommandBars.ActiveMenuBar
    ' For all found - delete them
    For Each C In MainMenuBar.Controls
    If C.Caption = "Test" Then Set TestMenuBar = C
    Next C
    End If
    TestMenuBar.Delete
    ...


    The special thing to specify here it that the code is placed in a Word Add-In Template, that acts on every document in the system when they are opened etc.
    If you just run the code in a Document it seem to work fine

    I can't find a specific pattern to how the Acrobat Add-In modifies my menu, but it is very annoying, and because it is a COM add-In and cannot be controlled (or even explained)
    My post was primarily to see if anybody else had seen some weird activity when modifying the MenuBar with the Adobe Add-In active, and maybe had some suggestions.

    Appreciate your help. Thanks

    :-)an

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Location
    Rochester, New York
    Posts
    8

    Resolved Re: [Resolved] Experience with Acrobat Add-In and Word CommandBar

    I finally resolved this issue with a lot of testing and retrying ....

    Recap: I am developing a VBA Add-In for Word that will allow me to control the editing of new documents.

    It all lies in CustomizationContext that guides where the changes to menus are activated.

    First found out that by changing CustimizationContext to ActiveDocument before any changes to the menus the menus are pretty stable including the Adobe menus.

    Second problem is that when I opened my template document it would screw up the menus on my already opened document. (I needed to open the template document to copy bookmarks from that document to my new document - you cannot copy context from a loaded Add-In - the document has to be openend as an active document). It seemed like the Acrobat Add-In (or effects thereoff) would run on my already opened document and it would mess up the menus.

    The solution is to change the CustomizationContext to the document I am openening before I open it. I can do that because the document is already loaded as an Add-In and I can refer to ThisDocument in the macros.
    I then change the CustomizationContext back to ActiveDocument after the template is closed again. Now there are no changes to the menu of the Document I am working on.

    I have been trying to get some info from the Adobe Forums about the Acrobar COM Add-In, but with no luck. It would be nice to know exactly what it is doing and then taylor the solution to that.

    :-)an

Posting Permissions

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



Click Here to Expand Forum to Full Width