Re: MsgBox Timeout
- From: "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 10 Jul 2007 14:22:19 -0500
The difference is that the scripting example has the function return a
value, which is assigned to the variable. You use either:
intReturn = objShell.Popup("Click Yes or No!", 20, "My Title", vbYesNo +
vbQuestion)
or:
objShell.Popup "Message", 20, "My Title"
In the first example, you can test with code similar to:
If (intReturn = vbYes) Then
' User clicked "Yes".
End If
If (intReturn = vbNo) Then
' User clicked "No".
End If
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--
"Marcus Cotey" <MarcusCotey@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AFDE4D9D-476A-4475-A7C9-8C1158BA7D7E@xxxxxxxxxxxxxxxx
Interesting. That definitely worked. Sorry for the confusion. I was
going
by the Scripting Guys example here which is why I had the ().
http://www.microsoft.com/technet/scriptcenter/resources/qanda/mar05/hey0314.mspx
"S Moran" wrote:
no, remove the parenthesis surrounding PopUp.
you have: objShell.PopUp("something in here")
you should have: objShell.PopUp "something in here"
"Marcus Cotey" <MarcusCotey@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6071C063-C3C8-4567-9E45-79465D11B8FB@xxxxxxxxxxxxxxxx
Please elaborate...you are saying that the equation I am using to
convert
the
AD password age to a readable format (nanoseconds to seconds to days)
is
actually a subroutine even though I haven't defined it as a subroutine?
"S Moran" wrote:
but you are.
remove the parenthesis or set a variable to contain the return value
"Marcus Cotey" <MarcusCotey@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
news:5875EDA4-7B6B-482A-8CC3-34DF949856AC@xxxxxxxxxxxxxxxx
Before anyone replies let state first I have tried wshShell.PopUp
and
it
won't work because I am displaying some output that it thinks is
calling a
subroutine.
So what I am doing is writing a login script for our company and
part
of
that is displaying mapped drives as well as when the password
expires.
Well
near as I can tell when I use the PopUp method it thinks the
equations
I
have
in the script to determine password age is a subroutine and returns
an
error
"Cannot use parantheses when calling a Sub" and the error Code:
800A0414.
I am not calling a subroutine but it seems to think so.
Here is the code:
objShell.PopUp ("*** MyCompany Windows Login Process***" & VbCrLf &_
"Good day " & objUser.FullName & VbCrLf &_
"Your password will expire on: " & VbCrLf &_
DateValue(dtValue + dblMaxPwdDays) & " (" & _
Int((dtValue + dblMaxPwdDays) - Now) & " days from today)." & VbCrLf
&_
VbCrLf &_
"Current Drive Mappings: " & VbCrLf &_
strMsg & VbCrLf &_
VbCrLf &_
"If you are having login problems please " & VbCrLf &_
"contact the IT Help Desk at 555.555.5555", 0, "MyCompany Login
Script")
Any help would be greatly appreciated.
.
- Follow-Ups:
- Re: MsgBox Timeout
- From: Marcus Cotey
- Re: MsgBox Timeout
- References:
- Re: MsgBox Timeout
- From: S Moran
- Re: MsgBox Timeout
- From: S Moran
- Re: MsgBox Timeout
- From: Marcus Cotey
- Re: MsgBox Timeout
- Prev by Date: Re: MsgBox Timeout
- Next by Date: Re: Calling SQL Stored procedures from web controls
- Previous by thread: Re: MsgBox Timeout
- Next by thread: Re: MsgBox Timeout
- Index(es):
Relevant Pages
|