Consulting

Results 1 to 4 of 4

Thread: Custom buttons in the print preview.

  1. #1
    VBAX Mentor
    Joined
    Dec 2008
    Posts
    404
    Location

    Custom buttons in the print preview.

    Is it possible for buttons added to PrinPreview Tab to work?

    My XML code:
    <customUI  xmlns="http://schemas.microsoft.com/office/2006/01/customui" >
        <ribbon >
            <tabs >
                <tab  idMso="TabPrintPreview" >
                    <group 
                        id="rxgrp_Send"
                        label="My New Group">
                        <button 
                            id="rxbtn_Send1"
                            imageMso="ArrangeByTo"
                            label="Button 1"
                            size="large"
                            onAction="rxbtn_Send1_onAction"/>
                        <button 
                            id="rxbtn_Send2"
                            imageMso="NewOutlookDataFile"
                            label="Button 2"
                            size="large"
                            onAction="rxbtn_Send2_onAction"/>
                    </group >
                </tab >
            </tabs >
        </ribbon >
    </customUI >
    The buttons on the Tab are created, but they do not work.
    I have some concerns that it might be impossible to do.

    In the attachment I showed an example.

    Artik
    Attached Files Attached Files

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,770
    Location
    Hmmm - I'm guessing that the PrintPreview screen display is special somehow and blocks everything else, emphasis on the 'guess'
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    VBAX Mentor
    Joined
    Dec 2008
    Posts
    404
    Location
    Leaving aside the issue of ribbon, if your procedure provides for programmatically displaying the print preview and then any other actions, then the code execution is suspended while the preview window is displayed. Will move on only after the window is closed. That is why I expressed my concerns that this task may not be feasible from within Excel. This would probably be possible from the COM add-on level. But COM is not my garden.
    At least I would ask you to confirm that the task cannot be solved from within Excel.

    Artik

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,770
    Location
    At least I would ask you to confirm that the task cannot be solved from within Excel.
    This is not the same as saying Excel can't do it, but I couldn't get it to work. The Ribbon button handler never even seems to fire


    I put a breakpoint there

    I added a "Stop"

    I added a "Beep

    I used .Statusbar = ...


    Nothing seems to happen
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Posting Permissions

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