Solved

Visio 2013 VBA - Message Box Questions

Posted on 2014-01-28
2
708 Views
Last Modified: 2014-02-02
Here is the message box I'm creating:
MsgBox "DOUBLE-CLICK a desired city to view its detailed diagram." & vbCrLf & vbCrLf& "Press ALT + left arrow", , "some company name"

Open in new window


There are two things I'm having aproblem with:
1.  I want to have TWO blank lines inbetween my first text message and my second message.  Is there a more compact way to ask for Two VBCRLF?
2.  I would like to insert a graphic for the left arrow symbol rather than the words "left arrow"  ¿  For some reason I can't even show the left pointing arrow here!  It shows up as an upside down question mark.
0
Comment
Question by:brothertruffle880
2 Comments
 
LVL 4

Assisted Solution

by:ravikantninave
ravikantninave earned 250 total points
ID: 39815857
1]  I didn't find any alternate for vbcrlf.  
2] To show Left arrow the least solution is to use chr(62).  Check the example.
MsgBox "DOUBLE-CLICK a desired city to view its detailed diagram." & vbNewLine & vbCrLf & "Press ALT + left arrow -" + Chr(62), , "some company name"

Open in new window


Hope it helps you.
0
 
LVL 30

Accepted Solution

by:
Scott Helmers earned 250 total points
ID: 39817652
The standard set of printable ASCII characters, which you can use easily in VBA, does not include a true left arrow so your use of "Press ALT + left arrow" may be the best alternative.

[NOTE: ravikantninave's suggestion of using chr(62) should probably be chr(60) because chr(60) is the left-pointing "less than" symbol.  Regardless, using those symbols will be misleading in your msgbox because the user will probably press the "<" key rather than the left arrow key.]

Re part 1 of your question about vbCrLf: one way to shorten your text string is simply to define a contstant that you can then use as shown below:
Const CrLf2 As String = vbCrLf & vbCrLf

MsgBox "first line of message" & CrLf2 & "second line of message"

Open in new window

One other style suggestion: if part of the problem is that your code is hard to read because the parameters for the msgbox statement continue off the screen to the right, you can use the underscore character to indicate that the command continues on the next line, e.g.,
MsgBox "DOUBLE-CLICK a desired city to view its detailed diagram." & _
       vbCrLf & vbCrLf & "Press ALT + left arrow", , _
       "some company name"

Open in new window

0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A recent Visio zone question asked how to use the data in an Excel file to create a Visio Gantt chart -- and then to dynamically update the Gantt chart. The good news is that the Viso Gantt Chart wizard can be automated. The bad news is that the…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

20 Experts available now in Live!

Get 1:1 Help Now