SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    A dymo labelprinter with VBscript and PHP

    The following example code was given from dymo.com on how to use VBA to print records from a mySQL database directly to the dymo labelwriter. The example works fine. I run my query, and replace the example name below with one address from the mySQL database search. The problem is that I don't know VBA very well. I need to tweak this so that clicking one print button will print ALL of the results that are returned from the database. Can anyone help me with this?

    Thanks!


    Code:
    <HTML>
    <HEAD>
    <SCRIPT LANGUAGE=VBScript>
    Sub Btn1_onclick()
    Dim DymoAddIn, DymoLabel
    Set DymoAddIn = CreateObject("DYMO.DymoAddIn")
    Set DymoLabel = CreateObject("DYMO.DymoLabels")
    
    DymoAddIn.Open "C:\Program Files\Dymo Label\Label Files\Address  (30252, 30320).LWT"
    DymoLabel.SetAddress 1,"Pablo Martini"+chr(10)+"SAMPLE Corporation"+chr(10)+"333 W. Fantasy World"+chr(10)+"Santaland, NP 99999-9999"
    DymoAddIn.Print 1, TRUE
    End Sub
    </SCRIPT>
    <TITLE>Label Printing Demo</Title>
    </HEAD>
    <BODY>
    <Bold>Label Printing Demo</Bold><p>

  2. #2
    SitePoint Addict loadx's Avatar
    Join Date
    Jul 2004
    Location
    Melbourne, VIC, Australia
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok what you can do is connect to the db in php dump the data from your query to a txt file with delimeters like commas etc to separate the fields. With that inhand import that into access and using your vba script make the label writer print the file

    sorry i can't provide much else other than a method but if u need help coding it etc just drop another message and im sure we can all help you out

    goodluck

  3. #3
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The whole goal is to be able to print via the webpage. Like I said, it works great for printing one label at a time using the VBA script offered by dymo.com However, I would like to manipulate the code so that when I click the print button, all labels shown on the webpage will be printed.

    Thanks.


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
  •