Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Resize Message Box

Hi All,

I am trying to display a large amount of information to the user within a
message box but can't work out how to specify the width of the box.

As the width of the box is too small, my text word wraps whereas I want each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I need to use a
useform.

Would really appreciate it if someone could give me a pointer.

Thanks

Andy


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Resize Message Box

Andy

I'm not sure if you can autosize a messagebox but you could try something
like:

Range("A1").Comment.Shape.Width = 150

Regards
Rowan

"Andibevan" wrote:

Hi All,

I am trying to display a large amount of information to the user within a
message box but can't work out how to specify the width of the box.

As the width of the box is too small, my text word wraps whereas I want each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I need to use a
useform.

Would really appreciate it if someone could give me a pointer.

Thanks

Andy



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Resize Message Box

Use a Chr(10), for example

msgbox "hello" & Chr(10) & "goodbye" & chr(10) & "taht's it"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
Hi All,

I am trying to display a large amount of information to the user within a
message box but can't work out how to specify the width of the box.

As the width of the box is too small, my text word wraps whereas I want

each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I need to use a
useform.

Would really appreciate it if someone could give me a pointer.

Thanks

Andy




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Resize Message Box

I believe it can be resized using the windows API, but code I have seen to
customize a message box is voluminous - easier to use a userform I would
think.

--
Regards,
Tom Ogilvy


"Andibevan" wrote in message
...
Hi All,

I am trying to display a large amount of information to the user within a
message box but can't work out how to specify the width of the box.

As the width of the box is too small, my text word wraps whereas I want

each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I need to use a
useform.

Would really appreciate it if someone could give me a pointer.

Thanks

Andy




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Resize Message Box

Sorry Bob,

I think it would be clearer if I gave you the code:-

MsgBox "Copy Information from:- C:\Documents and Settings\abevan\My
Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"

When I try this it appears on 2 lines but I want it to appear on one.

Any ideas?

Ta

Andi


"Bob Phillips" wrote in message
...
Use a Chr(10), for example

msgbox "hello" & Chr(10) & "goodbye" & chr(10) & "taht's it"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in

message
...
Hi All,

I am trying to display a large amount of information to the user within

a
message box but can't work out how to specify the width of the box.

As the width of the box is too small, my text word wraps whereas I want

each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I need to use a
useform.

Would really appreciate it if someone could give me a pointer.

Thanks

Andy








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Resize Message Box

Tom,

You may well be right - I seem to remember that you can generate a line of
code to generate a userform - am I correct or imagining things?

Ta

Andy

"Tom Ogilvy" wrote in message
...
I believe it can be resized using the windows API, but code I have seen to
customize a message box is voluminous - easier to use a userform I would
think.

--
Regards,
Tom Ogilvy


"Andibevan" wrote in

message
...
Hi All,

I am trying to display a large amount of information to the user within

a
message box but can't work out how to specify the width of the box.

As the width of the box is too small, my text word wraps whereas I want

each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I need to use a
useform.

Would really appreciate it if someone could give me a pointer.

Thanks

Andy






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Resize Message Box

When I run that, it all appears on one line !

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
Sorry Bob,

I think it would be clearer if I gave you the code:-

MsgBox "Copy Information from:- C:\Documents and Settings\abevan\My
Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"

When I try this it appears on 2 lines but I want it to appear on one.

Any ideas?

Ta

Andi


"Bob Phillips" wrote in message
...
Use a Chr(10), for example

msgbox "hello" & Chr(10) & "goodbye" & chr(10) & "taht's it"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in

message
...
Hi All,

I am trying to display a large amount of information to the user

within
a
message box but can't work out how to specify the width of the box.

As the width of the box is too small, my text word wraps whereas I

want
each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I need to use a
useform.

Would really appreciate it if someone could give me a pointer.

Thanks

Andy








  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Resize Message Box

Generally, you insert a userform and put a label on it. Make it as wide
as you need. then you show the form

userform1.show

in the initialize event you could do

Private sub Userform_Initialize()
label1.caption = _
"Copy Information from:- C:\Documents and Settings\abevan\My" & _
"Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"
End sub

back to the message box, you could try:

Sub showmsg()
sStr = "Copy Information from:"
sStr1 = "C:\Documents and Settings\abevan\My" & _
"Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"
MsgBox sStr & vbNewLine & sStr1

End Sub

That might work for you



--
Regards,
Tom Ogilvy

"Andibevan" wrote in message
...
Tom,

You may well be right - I seem to remember that you can generate a line of
code to generate a userform - am I correct or imagining things?

Ta

Andy

"Tom Ogilvy" wrote in message
...
I believe it can be resized using the windows API, but code I have seen

to
customize a message box is voluminous - easier to use a userform I would
think.

--
Regards,
Tom Ogilvy


"Andibevan" wrote in

message
...
Hi All,

I am trying to display a large amount of information to the user

within
a
message box but can't work out how to specify the width of the box.

As the width of the box is too small, my text word wraps whereas I

want
each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I need to use a
useform.

Would really appreciate it if someone could give me a pointer.

Thanks

Andy








  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Resize Message Box

Apologies again, I copied the wrong line - it also appears correctly on
mine

This one does appear on 2 lines on my screen.
MsgBox "Copy Information from:- C:\Documents and Settings\abevan\My
Documents\SM Parti\Drive_H\WIP\WIP - Weekly Checkin\Start\blahblahblahblah"

Maybe there is a way to turn of word wrapping in a message box?


"Bob Phillips" wrote in message
...
When I run that, it all appears on one line !

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in

message
...
Sorry Bob,

I think it would be clearer if I gave you the code:-

MsgBox "Copy Information from:- C:\Documents and Settings\abevan\My
Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"

When I try this it appears on 2 lines but I want it to appear on one.

Any ideas?

Ta

Andi


"Bob Phillips" wrote in message
...
Use a Chr(10), for example

msgbox "hello" & Chr(10) & "goodbye" & chr(10) & "taht's it"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in

message
...
Hi All,

I am trying to display a large amount of information to the user

within
a
message box but can't work out how to specify the width of the box.

As the width of the box is too small, my text word wraps whereas I

want
each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I need to use

a
useform.

Would really appreciate it if someone could give me a pointer.

Thanks

Andy










  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Resize Message Box

Thanks Tom - I will have a play around with your suggestion and see how far
I get.

"Tom Ogilvy" wrote in message
...
Generally, you insert a userform and put a label on it. Make it as wide
as you need. then you show the form

userform1.show

in the initialize event you could do

Private sub Userform_Initialize()
label1.caption = _
"Copy Information from:- C:\Documents and Settings\abevan\My" & _
"Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"
End sub

back to the message box, you could try:

Sub showmsg()
sStr = "Copy Information from:"
sStr1 = "C:\Documents and Settings\abevan\My" & _
"Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"
MsgBox sStr & vbNewLine & sStr1

End Sub

That might work for you



--
Regards,
Tom Ogilvy

"Andibevan" wrote in

message
...
Tom,

You may well be right - I seem to remember that you can generate a line

of
code to generate a userform - am I correct or imagining things?

Ta

Andy

"Tom Ogilvy" wrote in message
...
I believe it can be resized using the windows API, but code I have

seen
to
customize a message box is voluminous - easier to use a userform I

would
think.

--
Regards,
Tom Ogilvy


"Andibevan" wrote in

message
...
Hi All,

I am trying to display a large amount of information to the user

within
a
message box but can't work out how to specify the width of the box.

As the width of the box is too small, my text word wraps whereas I

want
each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I need to use

a
useform.

Would really appreciate it if someone could give me a pointer.

Thanks

Andy












  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Resize Message Box

Guess what - one line for me/

This is how I understand MsgBox to work.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
Apologies again, I copied the wrong line - it also appears correctly on
mine

This one does appear on 2 lines on my screen.
MsgBox "Copy Information from:- C:\Documents and Settings\abevan\My
Documents\SM Parti\Drive_H\WIP\WIP - Weekly

Checkin\Start\blahblahblahblah"

Maybe there is a way to turn of word wrapping in a message box?


"Bob Phillips" wrote in message
...
When I run that, it all appears on one line !

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in

message
...
Sorry Bob,

I think it would be clearer if I gave you the code:-

MsgBox "Copy Information from:- C:\Documents and Settings\abevan\My
Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"

When I try this it appears on 2 lines but I want it to appear on one.

Any ideas?

Ta

Andi


"Bob Phillips" wrote in message
...
Use a Chr(10), for example

msgbox "hello" & Chr(10) & "goodbye" & chr(10) & "taht's it"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in
message
...
Hi All,

I am trying to display a large amount of information to the user

within
a
message box but can't work out how to specify the width of the

box.

As the width of the box is too small, my text word wraps whereas I

want
each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I need to

use
a
useform.

Would really appreciate it if someone could give me a pointer.

Thanks

Andy












  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Resize Message Box

I give up - I can only presume that the maximum size of a MSGBOX is
dependent on your screen size and configuration. As a result I will give up
on this simple approach and have to do something a bit more involved.

Thanks for you help though :-)

Andi


"Bob Phillips" wrote in message
...
Guess what - one line for me/

This is how I understand MsgBox to work.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in

message
...
Apologies again, I copied the wrong line - it also appears correctly on
mine

This one does appear on 2 lines on my screen.
MsgBox "Copy Information from:- C:\Documents and Settings\abevan\My
Documents\SM Parti\Drive_H\WIP\WIP - Weekly

Checkin\Start\blahblahblahblah"

Maybe there is a way to turn of word wrapping in a message box?


"Bob Phillips" wrote in message
...
When I run that, it all appears on one line !

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in

message
...
Sorry Bob,

I think it would be clearer if I gave you the code:-

MsgBox "Copy Information from:- C:\Documents and Settings\abevan\My
Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"

When I try this it appears on 2 lines but I want it to appear on

one.

Any ideas?

Ta

Andi


"Bob Phillips" wrote in message
...
Use a Chr(10), for example

msgbox "hello" & Chr(10) & "goodbye" & chr(10) & "taht's it"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote

in
message
...
Hi All,

I am trying to display a large amount of information to the user
within
a
message box but can't work out how to specify the width of the

box.

As the width of the box is too small, my text word wraps whereas

I
want
each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I need to

use
a
useform.

Would really appreciate it if someone could give me a pointer.

Thanks

Andy














  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Resize Message Box

That may well be it. I have a resolution of 1600x1200 on my laptop, so I get
quite a bit of real estate.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
I give up - I can only presume that the maximum size of a MSGBOX is
dependent on your screen size and configuration. As a result I will give

up
on this simple approach and have to do something a bit more involved.

Thanks for you help though :-)

Andi


"Bob Phillips" wrote in message
...
Guess what - one line for me/

This is how I understand MsgBox to work.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in

message
...
Apologies again, I copied the wrong line - it also appears correctly

on
mine

This one does appear on 2 lines on my screen.
MsgBox "Copy Information from:- C:\Documents and Settings\abevan\My
Documents\SM Parti\Drive_H\WIP\WIP - Weekly

Checkin\Start\blahblahblahblah"

Maybe there is a way to turn of word wrapping in a message box?


"Bob Phillips" wrote in message
...
When I run that, it all appears on one line !

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in
message
...
Sorry Bob,

I think it would be clearer if I gave you the code:-

MsgBox "Copy Information from:- C:\Documents and

Settings\abevan\My
Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"

When I try this it appears on 2 lines but I want it to appear on

one.

Any ideas?

Ta

Andi


"Bob Phillips" wrote in

message
...
Use a Chr(10), for example

msgbox "hello" & Chr(10) & "goodbye" & chr(10) & "taht's it"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote

in
message
...
Hi All,

I am trying to display a large amount of information to the

user
within
a
message box but can't work out how to specify the width of the

box.

As the width of the box is too small, my text word wraps

whereas
I
want
each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I need

to
use
a
useform.

Would really appreciate it if someone could give me a pointer.

Thanks

Andy
















  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Resize Message Box

Remember that providing messages to the user is an
art which must be handled carefully. Everything must
go through one of the "media" sensory systems you
have available. Right now you are targeting visual
messaging.

If you must present a great deal of information then
creating your own "form" and displaying it is probably
the best way to go. If you have only a limited amount
to display using the built-in "MsgBox" capability is
easier than re-inventing Rome.

If you are really "big" into using the "Msgbox" you
can use a lot of the "built-in" Microsoft "goodies"
to make the "window" look pretty. For example:
you can use the "vbTab" and the "vbCrLf" to add
both vertical and horizontal spacing.

Yes, the size *is* controlled by the size of the user's
screen so you really need to plan for the screen of
user with *smallest* monitor not the largest. The
best thing is to remember the KISS principle when
using MsgBox - "Keep It Simple (Stupid)", That
way the message shouldn't over-flow the screen
display.

David

"Andibevan" wrote in message
...
Thanks Tom - I will have a play around with your suggestion and see how

far
I get.

"Tom Ogilvy" wrote in message
...
Generally, you insert a userform and put a label on it. Make it as

wide
as you need. then you show the form

userform1.show

in the initialize event you could do

Private sub Userform_Initialize()
label1.caption = _
"Copy Information from:- C:\Documents and Settings\abevan\My" & _
"Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"
End sub

back to the message box, you could try:

Sub showmsg()
sStr = "Copy Information from:"
sStr1 = "C:\Documents and Settings\abevan\My" & _
"Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"
MsgBox sStr & vbNewLine & sStr1

End Sub

That might work for you



--
Regards,
Tom Ogilvy

"Andibevan" wrote in

message
...
Tom,

You may well be right - I seem to remember that you can generate a

line
of
code to generate a userform - am I correct or imagining things?

Ta

Andy

"Tom Ogilvy" wrote in message
...
I believe it can be resized using the windows API, but code I have

seen
to
customize a message box is voluminous - easier to use a userform I

would
think.

--
Regards,
Tom Ogilvy


"Andibevan" wrote in
message
...
Hi All,

I am trying to display a large amount of information to the user

within
a
message box but can't work out how to specify the width of the

box.

As the width of the box is too small, my text word wraps whereas I

want
each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I need to

use
a
useform.

Would really appreciate it if someone could give me a pointer.

Thanks

Andy












  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Resize Message Box

I am working on a work laptop which is lovely and light but about the size
of a box of matches.

Ta

Andi

"Bob Phillips" wrote in message
...
That may well be it. I have a resolution of 1600x1200 on my laptop, so I

get
quite a bit of real estate.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in

message
...
I give up - I can only presume that the maximum size of a MSGBOX is
dependent on your screen size and configuration. As a result I will

give
up
on this simple approach and have to do something a bit more involved.

Thanks for you help though :-)

Andi


"Bob Phillips" wrote in message
...
Guess what - one line for me/

This is how I understand MsgBox to work.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in

message
...
Apologies again, I copied the wrong line - it also appears

correctly
on
mine

This one does appear on 2 lines on my screen.
MsgBox "Copy Information from:- C:\Documents and Settings\abevan\My
Documents\SM Parti\Drive_H\WIP\WIP - Weekly
Checkin\Start\blahblahblahblah"

Maybe there is a way to turn of word wrapping in a message box?


"Bob Phillips" wrote in message
...
When I run that, it all appears on one line !

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote

in
message
...
Sorry Bob,

I think it would be clearer if I gave you the code:-

MsgBox "Copy Information from:- C:\Documents and

Settings\abevan\My
Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"

When I try this it appears on 2 lines but I want it to appear on

one.

Any ideas?

Ta

Andi


"Bob Phillips" wrote in

message
...
Use a Chr(10), for example

msgbox "hello" & Chr(10) & "goodbye" & chr(10) & "taht's it"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan"

wrote
in
message
...
Hi All,

I am trying to display a large amount of information to the

user
within
a
message box but can't work out how to specify the width of

the
box.

As the width of the box is too small, my text word wraps

whereas
I
want
each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I need

to
use
a
useform.

Would really appreciate it if someone could give me a

pointer.

Thanks

Andy




















  #16   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Resize Message Box

Yeah, mine is a personal Sony Vaio. It has a bi screen (16"),great
resolution (1600x1200 max), but it is quite heavy.

Bob


"Andibevan" wrote in message
...
I am working on a work laptop which is lovely and light but about the size
of a box of matches.

Ta

Andi

"Bob Phillips" wrote in message
...
That may well be it. I have a resolution of 1600x1200 on my laptop, so I

get
quite a bit of real estate.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in

message
...
I give up - I can only presume that the maximum size of a MSGBOX is
dependent on your screen size and configuration. As a result I will

give
up
on this simple approach and have to do something a bit more involved.

Thanks for you help though :-)

Andi


"Bob Phillips" wrote in message
...
Guess what - one line for me/

This is how I understand MsgBox to work.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in
message
...
Apologies again, I copied the wrong line - it also appears

correctly
on
mine

This one does appear on 2 lines on my screen.
MsgBox "Copy Information from:- C:\Documents and

Settings\abevan\My
Documents\SM Parti\Drive_H\WIP\WIP - Weekly
Checkin\Start\blahblahblahblah"

Maybe there is a way to turn of word wrapping in a message box?


"Bob Phillips" wrote in

message
...
When I run that, it all appears on one line !

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote

in
message
...
Sorry Bob,

I think it would be clearer if I gave you the code:-

MsgBox "Copy Information from:- C:\Documents and

Settings\abevan\My
Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"

When I try this it appears on 2 lines but I want it to appear

on
one.

Any ideas?

Ta

Andi


"Bob Phillips" wrote in

message
...
Use a Chr(10), for example

msgbox "hello" & Chr(10) & "goodbye" & chr(10) & "taht's it"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan"

wrote
in
message
...
Hi All,

I am trying to display a large amount of information to

the
user
within
a
message box but can't work out how to specify the width of

the
box.

As the width of the box is too small, my text word wraps

whereas
I
want
each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I

need
to
use
a
useform.

Would really appreciate it if someone could give me a

pointer.

Thanks

Andy




















  #17   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Resize Message Box

Thanks David,

I am in agreement with you - ideally I would prefer to use message boxes as
the information I am trying to display is very simple (the location of a
file), the problem is that the on small laptops (like mine) the screen
margins cause a wordwrap effect for MSGBOX's (forgive me if my terminology
is incorrect but you get the idea). As a result I will probably end up
resorting to building a dynamic userform of some sort - like you say I feel
like I am going to end up re-inventing the wheel.

Andi


"David F. Schrader" wrote in message
...
Remember that providing messages to the user is an
art which must be handled carefully. Everything must
go through one of the "media" sensory systems you
have available. Right now you are targeting visual
messaging.

If you must present a great deal of information then
creating your own "form" and displaying it is probably
the best way to go. If you have only a limited amount
to display using the built-in "MsgBox" capability is
easier than re-inventing Rome.

If you are really "big" into using the "Msgbox" you
can use a lot of the "built-in" Microsoft "goodies"
to make the "window" look pretty. For example:
you can use the "vbTab" and the "vbCrLf" to add
both vertical and horizontal spacing.

Yes, the size *is* controlled by the size of the user's
screen so you really need to plan for the screen of
user with *smallest* monitor not the largest. The
best thing is to remember the KISS principle when
using MsgBox - "Keep It Simple (Stupid)", That
way the message shouldn't over-flow the screen
display.

David

"Andibevan" wrote in

message
...
Thanks Tom - I will have a play around with your suggestion and see how

far
I get.

"Tom Ogilvy" wrote in message
...
Generally, you insert a userform and put a label on it. Make it as

wide
as you need. then you show the form

userform1.show

in the initialize event you could do

Private sub Userform_Initialize()
label1.caption = _
"Copy Information from:- C:\Documents and Settings\abevan\My" & _
"Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"
End sub

back to the message box, you could try:

Sub showmsg()
sStr = "Copy Information from:"
sStr1 = "C:\Documents and Settings\abevan\My" & _
"Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"
MsgBox sStr & vbNewLine & sStr1

End Sub

That might work for you



--
Regards,
Tom Ogilvy

"Andibevan" wrote in

message
...
Tom,

You may well be right - I seem to remember that you can generate a

line
of
code to generate a userform - am I correct or imagining things?

Ta

Andy

"Tom Ogilvy" wrote in message
...
I believe it can be resized using the windows API, but code I have

seen
to
customize a message box is voluminous - easier to use a userform I

would
think.

--
Regards,
Tom Ogilvy


"Andibevan" wrote

in
message
...
Hi All,

I am trying to display a large amount of information to the user
within
a
message box but can't work out how to specify the width of the

box.

As the width of the box is too small, my text word wraps whereas

I
want
each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I need to

use
a
useform.

Would really appreciate it if someone could give me a pointer.

Thanks

Andy














  #18   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Resize Message Box

In that case, you *MAY* want to look into finding or
writing a function that takes a long file path and
"munges" it down to a pre-defined (by you) limited
length and replaces the "replaced portion" with a set
of ellipses (you know - "...").

If you pass the file name to that (just before) you pass
it to the MsgBox you'll get back a value that will
*always* fit. It looks a little odd (MS does/did it quite
a lot) but it makes displays cleaner. You get something
like:
C:\Windows\...\Quid\dev\xy3245\ddl9732.dll
C:\Windows\system32\...\xy3245\ddl9732.dll
C:\Windows\system32\hokem\...\ddl9732.dll

If you set the "length" quite short you could get something
like:
C:\Windows\...\ddl9732.dll
but that may defeat the entire purpose of what you're
trying to do.

I can't remember what they call this technique other than
"munging" although there are other (probably better)
names. I wrote one my self once - no don't ask it was
proprietary and I can't distribute it, sorry - so it's not
that hard to do, just a matter of making sure you get
everything handled in the right order.

Good luck Andi.

David

"Andibevan" wrote in message
...
Thanks David,

I am in agreement with you - ideally I would prefer to use message boxes

as
the information I am trying to display is very simple (the location of a
file), the problem is that the on small laptops (like mine) the screen
margins cause a wordwrap effect for MSGBOX's (forgive me if my terminology
is incorrect but you get the idea). As a result I will probably end up
resorting to building a dynamic userform of some sort - like you say I

feel
like I am going to end up re-inventing the wheel.

Andi


"David F. Schrader" wrote in message
...
Remember that providing messages to the user is an
art which must be handled carefully. Everything must
go through one of the "media" sensory systems you
have available. Right now you are targeting visual
messaging.

If you must present a great deal of information then
creating your own "form" and displaying it is probably
the best way to go. If you have only a limited amount
to display using the built-in "MsgBox" capability is
easier than re-inventing Rome.

If you are really "big" into using the "Msgbox" you
can use a lot of the "built-in" Microsoft "goodies"
to make the "window" look pretty. For example:
you can use the "vbTab" and the "vbCrLf" to add
both vertical and horizontal spacing.

Yes, the size *is* controlled by the size of the user's
screen so you really need to plan for the screen of
user with *smallest* monitor not the largest. The
best thing is to remember the KISS principle when
using MsgBox - "Keep It Simple (Stupid)", That
way the message shouldn't over-flow the screen
display.

David

"Andibevan" wrote in

message
...
Thanks Tom - I will have a play around with your suggestion and see

how
far
I get.

"Tom Ogilvy" wrote in message
...
Generally, you insert a userform and put a label on it. Make it

as
wide
as you need. then you show the form

userform1.show

in the initialize event you could do

Private sub Userform_Initialize()
label1.caption = _
"Copy Information from:- C:\Documents and Settings\abevan\My" & _
"Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"
End sub

back to the message box, you could try:

Sub showmsg()
sStr = "Copy Information from:"
sStr1 = "C:\Documents and Settings\abevan\My" & _
"Documents\SM Partition\Drive_H\WIP\WIP - Weekly Checkin\Start"
MsgBox sStr & vbNewLine & sStr1

End Sub

That might work for you



--
Regards,
Tom Ogilvy

"Andibevan" wrote in
message
...
Tom,

You may well be right - I seem to remember that you can generate a

line
of
code to generate a userform - am I correct or imagining things?

Ta

Andy

"Tom Ogilvy" wrote in message
...
I believe it can be resized using the windows API, but code I

have
seen
to
customize a message box is voluminous - easier to use a userform

I
would
think.

--
Regards,
Tom Ogilvy


"Andibevan" wrote

in
message
...
Hi All,

I am trying to display a large amount of information to the

user
within
a
message box but can't work out how to specify the width of the

box.

As the width of the box is too small, my text word wraps

whereas
I
want
each
piece of information to be contained on a seperate line.

Is it possible to set the size of a message box or do I need

to
use
a
useform.

Would really appreciate it if someone could give me a pointer.

Thanks

Andy
















Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Resize Validataion Message Help! dee Excel Discussion (Misc queries) 3 May 9th 07 09:15 PM
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 4 June 6th 06 04:46 AM
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 0 March 15th 06 10:34 AM
Resize name box Dave Peterson Setting up and Configuration of Excel 0 January 19th 05 01:01 AM
Displaying a message in a message box without requiring user to click anything to proceed Android[_2_] Excel Programming 2 June 25th 04 06:44 PM


All times are GMT +1. The time now is 04:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"