Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Aug 2006
    Location
    Gtr London, England
    Posts
    256
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Test for toolbar button press (VBA Word 2003)

    Hi,

    I currently have a piece of independent software installed on Word that converts data to a barcode at a press of a button, that the software installed on the toolbar. The vba for this software is locked and I cant amend it.

    My query is, is it possible to for a macro, on closing, to test to see if a user has pressed this particular button and if not then to stop the document from closing, displaying a message to the user advising that they havent pressed the button??

    The problem is that I have users that occasionally forget to press this button to convert data to a barcode, resulting in a document going out, without the required barcode.

    Cheers.
    Lee

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Test for toolbar button press (VBA Word 2003)

    You could test whether barcode is present in the document - I presume that it uses a special font, so you could search for the font and put up a warning if the font is not found in the document.

  3. #3
    3 Star Lounger
    Join Date
    Aug 2006
    Location
    Gtr London, England
    Posts
    256
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Test for toolbar button press (VBA Word 2003)

    Hi Hans,

    Many thanks for that. Yes the barcode is set in a Arial font.

    If possible could you give me a few pointers on how I would write a search macro please?

    Regards.
    Lee

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Test for toolbar button press (VBA Word 2003)

    Are you sure that it's Arial? That is a standard Windows font and as far as I know, it is not very suitable for barcodes.

  5. #5
    3 Star Lounger
    Join Date
    Aug 2006
    Location
    Gtr London, England
    Posts
    256
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Test for toolbar button press (VBA Word 2003)

    Hi,

    Yes its definately Arial, its one of a few font options on the barcode configuration.

    I cant lay my hand to it now but we were having problems printing a barcode and someone on google mention using arial as the font, as well as the * at the start and end of the data to be changed to barcode.

    Regards.
    Lee

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Test for toolbar button press (VBA Word 2003)

    Could you attach a small sample document in which the button has been pressed? You can remove most of the text, as long as a bit of 'normal' text and a bit of barcode is left. Thanks in advance.

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Test for toolbar button press (VBA Word 2003)

    Bar code programs usually use a symbol font. If you select text in a symbol font and apply Arial, usually the symbol font doesn't change; it is protected by Word.

    I suppose it is possible to reconstruct a bar code using line-drawing characters from another Windows font, but it seems as though it could easily disintegrate through re-styling without the kind of protection applied to symbol fonts.

  8. #8
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Test for toolbar button press (VBA Word 2003)

    Is the barcode that is produced a graphic, or is it text that can be made larger and smaller by the font attributes setting?

    If it is a graphic then the code to find it will rely on finding something unique about that graphic.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

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