Solved

Visio 2013 VBA - Message Box Questions

Posted on 2014-01-28
2
735 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ability to add structure to Visio diagrams using containers, lists and callouts is one of my favorite features in Visio 2010. In this article we’ll examine lists. We’ll explore containers and callouts in separate articles. Prior to reading th…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

840 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