Zum Hauptinhalt gehen

Suche

Suche

Bartender Through Agilent Vee

Kommentare

2 Kommentare

  • Avatar
    Canguita

    Hello Brian,

     

    Thank you very much for your post.

     

    Please can you let us know which code are you using exactly?

     

    Please note that for printing you will need using this structure:

     

    In VB.NET

     

    'Declare a BarTender application
    variable


    Dim btApp As
    BarTender.Application


    'Declare a BarTender document variable


    Dim btFormat As
    BarTender.Format


    'Create a new instance of BarTender


    btApp = New BarTender.Application


    'Open a BarTender document


    btFormat = btApp.Formats.Open("c:\Format1.btw", False, "")


    'Print the document


    btFormat.PrintOut(False, False)


    'End the BarTender process


    btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges)

     

    In 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();


    // Open a BarTender document


    btFormat = btApp.Formats.Open("c:\\Format1.btw", false, "");


    // Print the document


    btFormat.PrintOut(false, false);


    // End the BarTender process


    btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);  

     

     

     

    If you want to save the document, then you will need using this structure:

     

    In VB.NET

     

    'Declare a BarTender application
    variable


    Dim btApp As
    BarTender.Application


    'Declare a BarTender document variable


    Dim btFormat As
    BarTender.Format


    'Create a new instance of BarTender


    btApp = New BarTender.Application


    'Open a BarTender document


    btFormat = btApp.Formats.Open("c:\Format1.btw", False, "")


    'Save the document out as a different name


    btFormat.SaveAs("c:\DemoAuto.btw",True)


    'End the BarTender process


    btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges)

     

    In 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();


    // Open a BarTender document


    btFormat = btApp.Formats.Open("c:\\Format1.btw", false, "");


    // Save the document out as a different name


    btFormat.SaveAs("c:\\DemoAuto.btw"true);


    // End the BarTender process


    btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);

     

     

    You can find more information in BarTender Help clicking on "Automating BarTender" > "Automation with ActiveX" > "Getting Started"

     

    Many thanks.

    0
  • Avatar
    Legacy Poster

    Thanks for the examples Carlos, they have been very helpful.

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.