Solved

Visio 2013 VBA - Message Box Questions

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Meetings to discuss business process can waste time, and often do .  The meeting's dialog can get confusing when participants have different professional perspectives and backgrounds.  A jointly-developed process picture helps wade through the confu…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 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