Problem copying MsgBox text in Vista
- From: "Paul Randall" <paulr901@xxxxxxxxxxxx>
- Date: Wed, 3 Oct 2007 10:20:27 -0600
In WXP your script can create an string of ANSI characters and display it in
a message box. You can manually copy all the characters from the message
box by hitting Ctrl-C while the message box is active, even if the original
string was too large to be displayed in the message box. No Chr(0) or any
character after it is displayed and thus can't be copied, but all other
characters can be displayed and copied. The result can be pasted into
Notepad and when saved to a file, exactly matches the original string
displayed in the message box with a few extra lines for the message box's
title and buttons.
This can be a handy way to collect and use debugging info while
troubleshooting a VBScript as long as what you display does not contain
Chr(0).
In Vista, it works pretty much the same, except when the copied message box
is pasted into Notepad, a carriage return Chr(13) is inserted ahead of every
linefeed Chr(10) character, even if the previous character is a Chr(13).
Single spaced text in the message box becomes doublespaced in Notepad.
I don't know if Vista handles VBScript's message boxes differently than WXP
or maybe Vista's Notepad works differently than XP's Notepad. Or maybe
Vista's clipboard or its interface works differently.
I'd like suggestions on how to get what I see when I copy message boxes in
Vista. I thought the whole idea of Windows is WYSIWYG.
-Paul Randall
.
- Follow-Ups:
- Re: Problem copying MsgBox text in Vista
- From: Richard Mueller [MVP]
- Re: Problem copying MsgBox text in Vista
- Prev by Date: Re: using datelastmodified
- Next by Date: Re: reading from text file and writing to spread***
- Previous by thread: RemovePrinter command not working in our login script?
- Next by thread: Re: Problem copying MsgBox text in Vista
- Index(es):