Toolbar macro blues

Discussion in 'AutoCAD' started by D Hartley, Apr 23, 2004.

  1. D Hartley

    D Hartley Guest

    If I put my vba project file "Project" in the c directory, this toobar
    button macro works just fine

    objToolbar0.AddToolbarButton 0, "Placer", "Placer", "^C^C & -vbarun
    c:/Project.dvb!Module2.Placer ;"

    However, if I place it in c:\Documents and Settings\David.OFFICE\My
    Documents,
    and use

    objToolbar0.AddToolbarButton 0, "Placer", "Placer", "^C^C & -vbarun
    c:/Documents and Settings/David.OFFICE/My
    Documents/Project.dvb!Module2.Placer ;"

    Now it apparently chokes on the spaces in the path (my guess, but I don't
    know)

    Any ideas on fixing this?

    Thanks a lot

    David
     
    D Hartley, Apr 23, 2004
    #1
  2. D Hartley

    Ed Jobe Guest

    Standard windows convention...put paths with spaces in them inside double
    quotes.
     
    Ed Jobe, Apr 23, 2004
    #2
  3. Two solutions...
    #1: at the -VBARUN prompt, if you put your macro name in quotes, you can
    use spaces. Use double quotes to get a string containing quotes. Something
    like:
    objToolbar0.AddToolbarButton 0, "Placer", "Placer", "^C^C & -vbarun
    ""c:/Documents and Settings/David.OFFICE/My
    Documents/Project.dvb!Module2.Placer"" ;"

    #2: Windows has short filenames associated with each long filename, for use
    with old programs that didn't like spaces. This should work:
    objToolbar0.AddToolbarButton 0, "Placer", "Placer", "^C^C &
    -vbarun c:/DOCUME~1/David.OFFICE/MYDOCU~1/Project.dvb!Module2.Placer ;"


    James
     
    James Belshan, Apr 23, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.