Solved

Visio 2013 VBA - Message Box Questions

Posted on 2014-01-28
2
748 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

724 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