跳至主內容

搜尋

搜尋

Excel Vba Print Preview

評論

5 條評論

  • Avatar
    Shotaro Ito

    Do you use BarTender 8.01?

    Exporting print preview from ActiveX is supported from BarTender 9.0, so at that time export preview was not available.

    Consider upgrade to the latest BarTender's Enterprise Automation Edition.

    (note Automation edition doesn't support exporting preview.)

     

    This topic might helps:

    http://forums.seagullscientific.com/index.php?/topic/781-activex-print-preview/

    0
  • Avatar
    Legacy Poster

    I guess instead of getting Bartender to open or export a preview of the image, I was seeing if I could get the Excel VBA code to send over a command to execute print preview command or hot keys in the application itself.  We do not need to print out or save the preview as a image.  We just need to check/verify the serial number that is pulled from an external database before printing.

    0
  • Avatar
    Shotaro Ito

    There's no command line option or ActiveX method to show preview window directly - you can show print dialog by /PD command line option, though.

    in VBA code..

    Set objShell = CreateObject("WScript.Shell")
    objShell.Run """<your bartend.exe's path>\bartend.exe"" /AF=""C:\test.btw"" /PD /X"
    0
  • Avatar
    Legacy Poster

    In the end, my manager bought Bartender 9.01 build 2524: International,Professional  and not the 10.0 Enterprise.

    I executed the code you gave me and method Run failed of object IWshShell3 . Is there any correction i should make with this code so it is acceptable by 9.01?

     

    Thanks - Art

    0
  • Avatar
    Shotaro Ito

    Unfortunately, Professional edition doesn't support Automation / Command line printing.

     

    In BarTender 10.1 Automation, you can show print preview dialog from ActiveX code - see below sample (C#).

    // Declare a BarTender application variable  
    
    BarTender.Application btApp; 
    
    
    
    // Declare a BarTender document variable  
    
    BarTender.Format btFormat; 
    
    
    
    // Create a new instance of BarTender  
    
    btApp = new BarTender.Application();
    
    
    
    // Set the BarTender dialogs visible 
    
    btApp.VisibleWindows = BarTender.BtVisibleWindows.btInteractiveDialogs;
    
    
    
    // Open a BarTender document 
    
    btFormat = btApp.Formats.Open("c:\\Format1.btw", false, "");
    
    
    
    // Show the preview window 
    
    btFormat.PrintPreview.Show();
    
    
    
    // Close the preview window 
    
    btFormat.PrintPreview.Close();
    
    
    
    // End the BarTender process  
    
    btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges); 
    
    
    0

登入寫評論。