Using VLisp to access function in MS Word.

Discussion in 'AutoCAD' started by chell, Jan 4, 2004.

  1. chell

    chell Guest

    Hello Everyone;

    My problem today is that I have a series of public functions/properties in a Word document that I wish to access from Acad's Visual Lisp. These same functions can be access from Acad's Vba language. Has anyone done this yet? Ideas?

    My general goal is to open a Word file, process the text by adding Acad formatting codes, and then put it into an mtext entity. My first attempt was to write the processing code into an Acad's Vba module but it quickly became apparent that there was a big speed penelty for crossing Acad's process space to access Word. Putting the processing code into a Word VBA module solved that problem. (Plus it allowed me to support AcadLT in a limited fashion).

    I next cobbled some VB code in Acad to call the functions in my Word document's VBA module. Though Acad did not have the type library info for my functions, it could still successfully call them. I'm not sure, but I think Acad's VBA system resolved the reference at runtime - ie Late Binding.

    Once I had the code working, I started on the user interface and found that VB had several limitations. While I could run a macro, I could not pass an arguement to a VB function from say, a menu macro. Also, I couldn't string the macro together with other functions. So, on to Visual Lisp...

    Sincerely;
    Michelle
     
    chell, Jan 4, 2004
    #1
  2. chell

    SpeedCAD Guest

    Hi...

    I have never connected MS Word with Visual LISP. But if I did it with Visual Basic. I recommend to you that you watch the following page:

    http://www.dsxcad.com/articles/article003.htm

    In that page there is an example of how to connect Excel and AutoCAD with Visual Lisp. Possibly that serves to you how guide.

    Un saludo de SpeedCAD... :)
    CHILE
    FORO: http://www.hispacad.com/foro
     
    SpeedCAD, Jan 5, 2004
    #2
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.