How can i display a message in the text window using VBA?

Posted on 2009-02-19
Last Modified: 2013-12-04
I would like to display message in the text window in a VBA application
Question by:BenCalvert
    LVL 11

    Accepted Solution

    You could do something like the attached code.  Also, instead of using SendCommand to call lisp to bring up the Text window, you coulfd use something like SendKeys to push the F2 to the AutoCAD window and bring up the Text Window a little more cleanly.

    Alternativel, Lisp has a lot better control over this sort of output. You might have better luck writing Lisp and to wrote what you want and calling that from VBA, or have VBA use another method to display the information to the user better suited to VBA coding like MsgBox.
    Sub textscr()
        ' Send To Command Line
        ThisDrawing.Utility.Prompt "This goes to the command line" & vbCrLf
        ' Activate Text Screen
        ThisDrawing.SendCommand "(textscr)(princ)" & vbCr
    End Sub

    Open in new window

    LVL 10

    Expert Comment

    also available is

    ThisDrawing.Utility.Prompt "YourMessageHere"

    LVL 10

    Expert Comment

    Oops sorry Darrinmcwi, your code has it already (It looks like a comment on my browser).

    Author Closing Comment

    This gives me the info I was looking for, thanks

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Our company has proprietary drawing files that we do not give to our customers for final documentation. Our customers now require that we give them these drawings. They understand that they are proprietary and do not require them to be in AutoCAD bu…
    If, like me, you find yourself repeatedly and tediously joining many segments (lines, arcs) in other people's drawings back into polylines that can be used more effectively in Computer Aided Machining and Laser Cutting, then this article is for you!…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now