Get NT network id when connected via Microsoft VPN
Set WshNet = WScript.CreateObject("WScript.Network")
NTId = WshNet.UserName
This works fine when logged in locally on the LAN.
However, it returns the local PC's user id when run on a PC when connected
to the network via a Microsoft VPN connection (PPTP). This may or may not
be the same as the NT Id.
How do I get the NT Id when connected via VPN?
JPL Tag: outlook folders Tag: 157255
file search
hi
do you know that is there any script that i can run it for all computer in
my domain (by sms deployment) to search a file and collect information for
that file ex:
exist or not.
thanks Tag: outlook folders Tag: 157254
Help with sctipt
Hi,
Can anyone help creating a script to:
Ex:
read txt file with two columns "username", "telephone"
search ad for the username
if find write de telephone else skip
Tanks
Pedro Tag: outlook folders Tag: 157247
Checking a password protected word doc
We have an automated system that converts word etc to HTML, we are
having a problem with it failing on password projected word documents.
(web upload, backend processing and web delivery)
We have tried many options with no sucess, what we would like is a wsh
script / asp or other that can look at a word document and just return
a yes or no as to whether it is protected, we can then refuse to
upload it, until the user has removed the protection.
Thanks
John Tag: outlook folders Tag: 157243
VB SQL Error?
Set rs = Server.CreateObject("ADODB.Recordset")
rsstatm = "SELECT * FROM F4105C"
rs.Open rsstatm, ConnSQL
rs.movefirst
do while not rs.eof
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1statm = "SELECT * FROM F4105 WHERE COITM =" rS("COITM")" AND COMCU =
"rS("COMCU")" AND COLEDG = '02'" AND COLEDG = '02'"
rs1.Open rs1statm, ConnAS400
//======================================================================
// Why this SQL Statement is error? "SELECT * FROM F4105 WHERE COITM ="
rS("COITM")" ...?
// Where is the error? How to solve?
//======================================================================
rs.movenext
loop
rs.close
Set rs = Nothing Tag: outlook folders Tag: 157241
detect and redirect I-mode users
Dear readers/posters,
I'm not very familiar to vbscript at all. That's to say, I
haven't got so far as to give it a try in programming. I know a thing or
two abou VB(a). and a little about HTML.
My problem/ request is the following.
I have a site, which uses frames. Nothing for I-mode, which cannpot cope
with that.
I wonder weather it is possible in a script, to detect an I-mode user
and redirect him/her to the I-mode part.
(which is under construction)
Anyone willing to write a trick for this, or give me a link where to
find it.
My Service provider does not support php or cgi or asp. (@home
Netherlands)
Take a look at my site if interested:
http://members.home.nl/bedlam
Thanks for your help. Tag: outlook folders Tag: 157238
RegExp question
Im only a novice at regex so go easy on me !
Im having a problem with some irish email names and domain names,.
is the ' an allowed character in email address.
Does anyone know of an regexp editor I can use to create validations like
this as is is not one of my strong points.
Here is my validation, does can anyone see any characters I have not allowed
and should do
Private Function isEmailAddr(ByVal mailaddress)
'Checks for a valid email address
Dim objRegExp , AmIValid, sCleanEmail
Set objRegExp = New RegExp
'// All on one line
objRegExp.Pattern =
"^([a-zA-Z0-9_'\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-
9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
'// End all on one line
AmIValid = objRegExp.Test(mailaddress)
If not AmIValid Then
isEmailAddr = False
Else
isEmailAddr = True
End If
End Function Tag: outlook folders Tag: 157237
Set the time??
Is it possible to synchronise the time of the local machine via VBS -
like the command "NET TIME \\SERVER /SET /Y"
Cheers.
Danny Tag: outlook folders Tag: 157230
Is it possible to set the system time from the web browser?
I need to synchronize the system time on the client computer with a server by the web browser
Is it possible to do by some VBScript or is it possible to run such script in a WSH launched by the web browser? Tag: outlook folders Tag: 157228
Create a Simple List of AD Users to .csv File
I need to create a list of users: FirstName; LastName; PhoneNumber;
Department for an OU. I need to be able to filter that PhoneNumber is
<>Null
I know that I did this last year - but ....
Thanks Niel Tag: outlook folders Tag: 157227
Detecting Blank CD-RW
The following code results in "Drive D: is not read (no media present)" whenever a BLANK (brand new) CD-RW is in the drive. How can I detect that a blank CD-RW is in the drive? There is no "IsBlank" property that I can find. I'm trying to determine if there is anything on the media and, if there is, the script erases the media (using CreateCD). Note that there is nothing wrong with the media (I've tried several disks, and can write on them fine. Once I've written on them, my script detects the media in the drive)
'*** Make sure CD-RW drive read
TestDrive = "D:
Set TestDriveObject = fso.GetDrive(TestDrive
If Not TestDriveObject.IsReady the
PromptStr = "Drive " & TestDrive & " is not ready (no media present)
PromptStr = PromptStr & CrLf & "Script terminated due to error
PromptButtons = vbOKOnly + vbCritica
ScriptExitCode = 9
TerminateScrip
End if Tag: outlook folders Tag: 157219
Opening a new browser, not a window
I have a need to open OWA in a new browser, not a new window.
How can I programatically open a new browser session to a web page below
http:\\<servername>\exchange\<userid
I need this to be in a new browser, not another page, because the password and userid get cached in the browser session. If I open in a new page, the credentials get saved until that session is closed. If I open in a new browser, then when that session/Page is closed, the credentials are cleare
I'm not a programmer and could not find anything about this on the Microsofts help page
Thanks in advanc
Gordo Tag: outlook folders Tag: 157218
Error en script .vbs
Hola, saludos.
He hecho dos scripts en vbs para borrar dos grupos de carpetas (folders)
El primero funciona correctamente, pero al ejecutar el segundo se genera
un error en línea 2, caracter 1, error "permiso denegado", código de
error 800A0046, y origen "error de Microsoft VBScript en tiempo de
ejecución".
Los scripts son los siguientes:
Set BorraRuntime = CreateObject("Scripting.FileSystemObject")
BorraRuntime.DeleteFolder "D:\Incredimail\Datos de
Incredimail\IM\Runtime\*.*"
Set BorraAttachments = CreateObject("Scripting.FileSystemObject")
BorraAttachments.DeleteFolder "D:\Incredimail\Datos de
Incredimail\IM\Identities\{F7E4AEE0-8C88-4707-BA5E-680B32381A99}\Message
Store\Attachments\*.*"
¿Cuál puede ser el error? Se trata simplemente de borrar dos grupos de
carpetas, pero no he conseguido hacerlo.
Gracias por la ayuda. Tag: outlook folders Tag: 157216
CreateObject("Microsoft.XMLhttp")
Hi to all,
does anyone know where to find a referende-guide for the
"Microsoft.XMLhttp"-object?
and how to save a picture-file from a (knowen) internet-address?
thank's to all for helping.
Marcus Tag: outlook folders Tag: 157209
createobject("adodb.command")
Hello,
Can some one tell me where I am going wrong. I am trying to execute a
stored procedure using vbscript. I can execute them in vb6, but cant get it
to work using active server pages.
The problem is : Each time i try to create a command object I get the
error - Activex cant create object ADODB.command. When I create an
ADODB.recordset the compiler passes this.
i.e
****************************************************************************
********
PAGE1. ASP
****************************************************************************
********
<!-- METADATA TYPE="typelib" FILE="C:\Program Files\Common
Files\System\ado\msado15.dll" -->
<!-- #INCLUDE FILE="PAGE2.asp" -->
<SCRIPT LANGUAGE = VBSCRIPT>
sub cmdButton1_onclick
test()
end sub
</SCRIPT>
<HTML>
<%
Response.write "<INPUT TYPE = button Name = cmdButton1 Value = Add>"
%>
</HTML>
****************************************************************************
********
PAGE2.ASP
****************************************************************************
********
<!-- METADATA TYPE="typelib"
FILE="C:\Program Files\Common
Files\System\ado\msado15.dll" -->
<SCRIPT LANGUAGE="VBSCRIPT" >
Function test()
dim objCommand
Dim adoStreamQuery
'Pass this ok
Set obJRs = CreateObject("ADODB.Recordset")
'Fail - Error: Activex component can not create object
ADODB.command
Set objCommand = CreateObject("ADODB.Command")
end function
</script>
Thanks... Tag: outlook folders Tag: 157203
mandatory fields
When creating new objects in ADSI from a class, I can see what properties
are mandatory by browsing AD with ADVW, by use of the schema management
tool, or by refering to MSDN Library. MSDN does provide the most
information.
Still, it is not clear to me how one can tell, when instantiating a new
object, which of the mandatory fields must be populated by the script writer
and which the system will populate (such as Object-SID).
Are there any general guidelines I might share with a student?
Thanks,
JB Fields Tag: outlook folders Tag: 157199
Unicode OpenTextFile and Search Problem
I have written a script in vbs that basically opens a set of selected files,
performs a search on each file and replaces each occurrence of a string with
a different string. This works fine on ASCII files.
However the original files that I will be searching are Unicode files. With
these files, even though I have stated in the OpenTextFile command that the
files are to be opened as Unicode, the search finds nothing. I have
confirmed that the files are unicode by checking the first two characters
are ASCII 255 and 254. If I copy the contents of the Unicode file to a new
text file the search works fine.
What is my problem? Do I have to have a search string that is written in
Unicode? I'm using RegExp to do the search. I do not want to save or convert
the original files.
I thought I'd find a solution in the newsgroups quickly on this one. But
have had no success yet. Please help as the script is fully functional
except for this "simple" problem.
Thanx in advance.
Rob Tag: outlook folders Tag: 157197
Help with script
I would like to determine if a machine is a workstation or a server. I am running the script below, but it keeps erroring out, by saying "<machine> does not have wmi installed"
' Specify NetBIOS name of the computer
strComputer = "\\image1
' Trap the error if WMI is not installed, or if the compute
' is off line
On Error Resume Nex
Set objWMIService = GetObject("winmgmts:"
& "{impersonationLevel=impersonate}!\\"
& strComputer & "\root\cimv2"
If Err.Number <> 0 The
On Error GoTo
Wscript.Echo strComputer & " does not have WMI installed
Els
On Error GoTo
Set colComputers = objWMIService.ExecQuery
("SELECT * FROM Win32_ComputerSystem"
For Each objComputer In colComputer
intRole = objComputer.DomainRol
Select Case intRol
Case
strRole = " is a standalone workstation
Case
strRole = " is a member workstation
Case
strRole = " is a standalone server
Case
strRole = " is a member server
Case
strRole = " is a backup domain controller
Case
strRole = " is a primary domain controller
End Selec
Wscript.Echo strComputer & strRol
Nex
End I Tag: outlook folders Tag: 157195
Find Particular Shortcut
The following code displays all shortcuts on a PC along with the path
and target. How can I modify this to find a specific shortcut? I
can't seem to find any documentation on this.
Set colItems = objWMIService.ExecQuery("Select * from
Win32_ShortcutFile",,48)
For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Target: " & objItem.Target
Next Tag: outlook folders Tag: 157193
Matching over multiple lines
Hello,
How would I match the following body of code (from { to })?
void foo ()
{
some code here
some more code here
and yet, still more code here
}
Thanks in Advance,
Sean Tag: outlook folders Tag: 157185
Matching {'s in VBSCript
Hello,
Given the following:
ifdef _cplusplus
extern "C"{
#endif
void foo1 () { ... somecode ...}
void foo2 () { ... somecode ...}
ifdef _cplusplus
}
#endif
beginning code segment, I would like to be able to format the code to
the following:
ifdef _cplusplus
extern "C"{
#endif
void foo1 ()
{
...
somecode
...
}
void foo2 ()
{
...
somecode
...
}
ifdef _cplusplus
}
#endif
I have tried the several regular expressions:
[^extern.*""C"".*]{
but it captures a character previous to the brace, is there a way to
just match the brace?
Thanks,
Sean Tag: outlook folders Tag: 157184
Error checking vbscript functions
I am trying to build a library of vbscript functions and I would like to build in error checking but I am running into a problem, or at least something I don't understand. I want the function to verify the variables it is passed before it begins. The first thing I want to check is that all the variables are specified, but when I tried to test for missing variables I found the error seems to be generated when the function is called but before control is passed to it
' Sample program to demonstrate CheckFreeSpace Functio
if (CheckFreeSpace ("c:", 1200000)) the
wscript.echo "ROOOOOOOMMMMMMMY!
els
wscript.echo "tight
end i
' End Sample program to demonstrate CheckFreeSpace Functio
Function CheckFreeSpace(drvPath, MBNeeded
' usage: if (CheckFreeSpace("c:", 12)) then something
' checks for free space. If the free space on the drive exceeds the
' amount requested returns true. Otherwise it returns false
' the MBNeeded is megabytes needed. d.FreeSpace returns byte
' so we devide by 1,000,000 to get megabytes, and yes I know abou
' using 1024, but 1,000,000 gets the same number as the DIR command
Dim fso, d,
Set fso = CreateObject("Scripting.FileSystemObject"
Set d = fso.GetDrive(fso.GetDriveName(drvPath)
if (d.FreeSpace/1000000 > MBNeeded) the
CheckFreeSpace = Tru
els
CheckFreeSpace = Fals
end i
End Function Tag: outlook folders Tag: 157182
Emulating IE6???
Hi All
I have written a script to test the source code returned by a "local box" web site. The idea being that if the site fails the script will pick it up and take corrective action. The only problem I have is that some of the newer site designs require IE6 in order to function
When I run the script against these sites they either fail or redirect to thier "old browser" sections
Is there a way I can get vbscript to emulate the IE6 browser, hence resolving this issue
Many thanks,
Aaron Tag: outlook folders Tag: 157178
Read from txt file and write AD
Hi,
Can anyone help creating a script to:
Ex:
read txt file with two columns "username", "telephone"
search ad for the username
if find write de telephone (if already exists replace if diferent, or skip
if equal)
else
skip
Tanks
Pedro Tag: outlook folders Tag: 157177
Colour & Move ?
Hi
I have the tabbed pages up and running but I cant find a way t
control the colour of the pages, I can change the colour of th
background behind the pages and the forecolour ( Font) but not th
pages themselves ?
For Buttons I would change the style to Graphical but there isnt tha
option for the tabbed page
I tried to use the MouseDown and MouseMove to move the Form withou
the title bar but it just jumped all over the place I had no contro
over it. I used the lines
Form1.Move x,
AND
Form1.Move(x-Form1.Width/2),(y-Form1.Height/2
I want to be able to click on it and drag it to another position, An
ideas :- Tag: outlook folders Tag: 157176
script to show physical and virtual memory available
I would like to run script to show the memory usage on a window 2000 server.
Then I would use the schedule to run it regularly to keep track of the
memory usage.
Please advise if I can do it.
Thanks.
JW. Tag: outlook folders Tag: 157173
Internet Options
There is a service Win32_NTEventLogFile in vbscript by which we can
clear,add, save events.
Is there any service for Internet Options(in control panel).
Here i want to clear forms and passwords.
waiting for reply Tag: outlook folders Tag: 157172
Determine Workstation or Server?
How, using VBScript, would I be able to determine if a computer is a WS or Server in AD? I have a script (WSH) that queries each computer in AD. If a computer is a Server, I would like certain code executed on it. I would like to use it in "If <server> then". Is there some type of property that would tell me this? Please let me know. Tag: outlook folders Tag: 157163
Job Open in Brooklyn, NY
hi all,
there is a job opening for a web developer and designer in brooklyn NY.
Please send all resumes to
jobs AT skynet22.com
replace the " AT " with @.
good luck to all candidates
rafael Tag: outlook folders Tag: 157162
enumerating Mapped drives
My script to output mapped drives works on win2k and NT but not on XP.
What changed?
Const INPUT_FILE_NAME = "C:\Scripts\Computers.txt"
Const FOR_READING = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(INPUT_FILE_NAME, FOR_READING)
strComputers = objFile.ReadAll
objFile.Close
arrComputers = Split(strComputers, vbCrLf)
For Each strComputer In arrComputers
On Error Resume Next
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colDisks = objWMIService.ExecQuery _
("Select * from Win32_LogicalDisk")
If Err.number = 0 Then
On Error GoTo 0
Wscript.Echo strComputer & VBCrLf
For each objDisk in colDisks
if objDisk.Description = "Network Connection" then
Wscript.Echo "DeviceID: " & vbTab & objDisk.DeviceID
Wscript.Echo "Name: " & vbTab & objDisk.Name
end if
Next
else
if strComputer <> "" Then
wscript.stdout.writeLine strComputer & " not found" & vbCrLf
End If
end if
Wscript.Echo VBCrLf & vbCrLf
Next Tag: outlook folders Tag: 157160
vbscript syntax
Where can I learn the code/syntax to write vbscript?
I suppose any coding in vb 6.0 is acceptable to vbscript.
I dont see books on VBSCRIPT, but ASPNET, JAVASCRIPT, PERL and so on. It
may appear that ASPNET is really VBSCRIPT. Is it?
Perhaps a book on WSH will detail samples in VBSCRIPT.
Can one of you help answer the question?
alan
--
alan Tag: outlook folders Tag: 157150
Sending email HTML for Lotus Notes
How can I send a email HTML for users Lotus Notes, with format MIME
I already tried send and for users Outlook, the emails shows in the body of email, but for users Lotus Notes, the email not shows correctly, its shows only text and not HTMLs
Someone knows whats hapenning
tks Tag: outlook folders Tag: 157145
Removing spaces for environment variable
I have the following in a batch file:
Set %1=<value>
ex. Set %1=TECRA S1
This value is written using a vb script that detects the system type
in the BIOS. Now, I'm then using this value to set an environment
variable, however, environment variables must not contain spaces so
that I can use IF GOTO statements in my batch file. I need an
addition to my vb script that will remove any spaces OR replace them
with underlines (which ever is easier) before writing the result to
the batch file. Here's an example of my vb script:
--->8----->8---
Dim I, fso, MyFile, s(200), item
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile("c:\temp\detect.bat", True)
Set SystemSet = GetObject
("winmgmts:").InstancesOf("Win32_ComputerSystem")
for each item in SystemSet
MyFile.WriteLine "Set %1=" & trim(item.Model)
next
MyFile.close
--->8----->8---
You'll notice that the "Set %1=" value will always be constant and
that it MUST contain a space therefore requiring the script to only
modify the value after the = sign.
I appreciate any help you can offer. Tag: outlook folders Tag: 157140
New Line with Response.Write
Hello all. I'm sure this is an easy one but can't get it to work. I
have a page that is pure ASP vbscript with no html that I am using to do
some database checks. I am using the Response.Write to write out the
info I need but need to start a new line with each Response.write. I
have tried vbcrlf and <br> and Chr(13)&Chr(10) but it doesn't work.
Please help me...
SusanC
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! Tag: outlook folders Tag: 157129
"Transaction deadlocked" problem
Greetings
I have a script that establishes a connection to an SQL database and creates severa
recordset objects via Select statements. I only want to extract data -- no updatin
needed. But I'm experiencing the following error condition
Transaction deadlocked on lock resources with another process and has been chose
as the deadlock victim. (Code: 80004005
I tried the following syntax on my recordset Opens
objRec.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnl
But this gave me a syntax error
Arguments of the wrong type, out of acceptable range, or in conflict with one another
Then I tried eliminating the ad* parameters entirely, which according to a VB manua
should default to a forward-only, read-only recordset. But I still get the "deadlock
condition
Can anyone offer any help on this? Would appreciate greatly
Thanks
To Tag: outlook folders Tag: 157127
Control page refreshing
I need to add a button to a page that can enable or disable page auto refreshing. Can anyone help me get this started
1. I want the page to refresh every 10 seconds by default and display a button "Stop Refresh
2. When user clicks button, it stops the auto refresh and button now reads "Start Auto Refresh
and so on. I am currently using only a meta tag for refreshing but cannot control it.
Thank
C Tag: outlook folders Tag: 157126
ODBC connections
Is there any way to create ODBC connections using vbscript? I don't want to use the gui for remote sites.
Thanks
Lou Tag: outlook folders Tag: 157123
Exe file stopped working from ASP script
Using IIS 5.0 under Win2k.
I have ASP code which uses WScript.Shell object to run an exe file on
the server. This code use to work fine but we just rebuilt the server
and it stopped working.
The server is internal server and Anonymous Access has been disabled.
It only uses windows authentication.
The exe file copies image from other server to local folder and 3
window user groups has been given full permission to this folder.
When I logon as an authenticated user and loads the page it doesn't
executes the exe file any more.
If I run the same command line locally on the server using one of the
authenticated user login, it works fine.
Same code and same exe is still working fine on different server.
Any help would be greatly appreciated.
Thanks a lot. Tag: outlook folders Tag: 157121
Page Refreshing
I need to add script to a page so there can be a button on the top that does the following
1. The page initially auto refreshes every 5 seconds and the button displayed at the top of the page reads "Stop Auto-Refresh
2. If you click on stop Auto-rrefresh, the page no longer refreshes and the button reads "Turn Auto-Refresh On
Can anyone help me get started
Thanks!! Tag: outlook folders Tag: 157119
Multi-folder update
Okay, here's what I'm trying to do;
I have 3 folders in the root of my site;
/upg - contains upgraded file's
/folder1
/folder 2
Now, what I'm wanting to do is copy the files from the "upg" folder, to
every sub-folder in "folder1" and "folder2". I wrote the code below to
acheive this, but for some reason, it's additionally copying all of the
folders from the first folder, to the second (i.e. the contents of folder1
to folder2..... which it is not supposed to be doing).
'// Begin
<%
'// shouldn't really be necessary but it keeps erroring if there's no
timeout specified.
server.scripttimeout = "5000"
dim fso
set fso = createobject("scripting.filesystemobject")
'// Set to folder1, is changed to folder2 when folder1 is complete
set flds = fso.getfolder(server.mappath("folder1"))
for each fld in flds.subfolders
fso.Copyfolder Server.MapPath("upg\"), fld.path, true
next
set fso = nothing
set flds = nothing
set fld = nothing
response.write "Done"
%>
'// End
--
Regards
Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk
Keeping it FREE!
Personal favourites
Practically Nerded - http://mvps.org/PracticallyNerded/
Bugs, Glitches n stuff - http://mvps.org/inetexplorer/Darnit.htm
Calendar of Updates - http://www.dozleng.com/updates/index.php?&act=calendar Tag: outlook folders Tag: 157118
Help with a script dealing with services
The client is Windows XP SP1.
In the properties of the service, under the recovery tab, I want to
modify the following:
first failure: Restart the service
second failure: restart the service
subsequent failure: restart the service
Can this be done with vbs scripting?
--
Eric Sabo
NT Administrator Tag: outlook folders Tag: 157111
Free Currency Conversion Web Services?
Is anyone aware of free currency conversion web services? I have an
application that the user must enter the currency conversion rate and if
possible I'd like them simply to pick the type of currency (and then
retrieve the latest conversion information).
Any help would be greatly appreciated.
BBB Tag: outlook folders Tag: 157110
How to get the current folder?
How can you get the current folder within a vbscript-program?
I worked around this problem by creating a filesystemobject with the
filename of my program and split the file-path... but if someone was
to change the filename of my program, this wouldn't be working
anymore...
Any suggestions? Tag: outlook folders Tag: 157105
Crete exel charts with asp
Hi
I found this code to crete excel charts, with asp, but Im having problems creating custom type charts, I think I need the gallery constants, but I don't know where to find. Can someane take alook at the code and advise
Thanks
Alban
Code asp and html source
<%@ LANGUAGE="VBSCRIPT" %><%
Option Explici
'--------------- WEB SITE: YOUR WEB SITE NAME ---------------
' File Name: 10MinChart.as
' Purpose
' Genearate a Chart using Microsoft Excel in an ASP pag
' Arguments
' Comment
' Author: Rama Ramachandra
' Imperium Solution
' http://www.imperium.co
' Internet: rama@imperium.co
' Date Created
' 8/29/200
' Modification History
'---------------------------------------------------------------------
Dim mintPass, mstrFileNam
Dim i ' misc variabl
Randomize Time
mintPass = Request("pass"
Select Case Int(mintPass
Case
HandleRepeatVisi
End Selec
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><TITLE>Create "Excel"lent Charts with ASP</TITLE><STYLE TYPE="text/css"><!-- /
BODY
font-family: Verdana, Arial, Helvetica, Sans Serif
font-size: 10pt
TH
font-family: Verdana, Arial, Helvetica, Sans Serif
font-size: 10pt
font-weight: bold
background-color: #DDDDDD
TD
font-family: Verdana, Arial, Helvetica, Sans Serif
font-size: 10pt
background-color: #EEEEEE
// --></STYLE></HEAD><BODY BGCOLOR="#FFFFFF"><BASEFONT FACE="Verdana, Arial, Helvetica, Sans Serif" SIZE="2"><FORM ACTION="10MinChart.asp" METHOD="post"><INPUT TYPE="hidden" NAME="pass" VALUE="1"><TABLE BORDER="0" CELLPADDING="5" CELLSPACING="2" WIDTH="750"><TR><TD ALIGN="CENTER" VALIGN="TOP" COLSPAN="3"><STRONG>Create "Excel" lent Charts with ASP!</STRONG></TD></TR><TR><TD ALIGN="CENTER" VALIGN="TOP" COLSPAN="3"><STRONG>- by Rama Ramachandran</STRONG>  
<FONT FACE="ARIAL" SIZE="1"><A HREF="10MinChart.Zip">Get the Code for this page here</A>.</FONT></TD></TR><TR><TD ALIGN="CENTER" VALIGN="TOP">Stock Price for:</TD><TD ALIGN="LEFT" VALIGN="TOP"><INPUT TYPE="text" NAME="co" SIZE="25" VALUE="Microsoft"></TD><TD ALIGN="CENTER" VALIGN="MIDDLE" ROWSPAN="13"><% If mstrFileName <> "" The
Response.write "<IMG SRC=""/graficos/chartExcel2/" & mstrFileName & """>"
Els
Response.write "<IMG SRC=""spacer.gif"" WIDTH=""100"" HEIGHT=""1"" BORDER=""0"">
End I
%></TD></TR><
For i = 1 to 12 %><TR><TD ALIGN="LEFT" VALIGN="TOP">Date: <%= FormatDateTime(i & "/01/99", 2)%></TD><TD ALIGN="LEFT" VALIGN="TOP">$ :<INPUT TYPE="text" NAME="v<%= i%>" VALUE="<% If mintPass=1 Then Response.Write Request("v" & i) Else Response.Write Int((100)*Rnd+1) End If %>" SIZE="10" MAXLENGTH="5"></TD></TR><
Next %></TABLE><INPUT TYPE="submit" NAME="cmd" VALUE=" Generate Chart"></FORM></BODY></HTML><
Sub HandleRepeatVisit(
Dim xlapp ' Our Excel Ap
Dim wb ' Our Workbook within the Excel Ap
Dim ws ' Our Worksheet within the Workbook
Dim crt ' The chart objec
Dim SourceRange ' The Source Range for the chart objec
Const xlWorkSheet = -4167
Const xlLineMarkers = 6
Const xlCombination = -411
Const xlColumn =
Const xlBuiltIn = 2
Const xlUserDefined = 2
' -- Create an instance of Excel Applicatio
Set xlapp = Server.CreateObject("Excel.Application"
' -- Create a new workboo
Set wb = xlapp.Workbooks.Add(xlWorksheet
' -- Grab the first worksheet of the new workboo
Set ws = wb.Worksheets(1
' -- Insert the data the user requeste
' -- First, the titl
ws.Range("A1").Value = Request("co") ' -- defaults to "Microsoft
' -- Then the data in two vertical column
For i = 1 To 1
ws.Range("A" & i + 1).Value = FormatDateTime(i & "/01/99", 2
ws.Range("B" & i + 1).Formula = "=" & Request("v" & i)
Nex
' -- Set our source range
Set SourceRange = ws.Range("A2:B13"
' -- Create a new Chart Objec
Set crt = ws.ChartObjects.Add(20, 20, 300, 200
' -- Generate the Chart using the ChartWizar
' -- Syntax is:
' -- crt.Chart.ChartWizard Source:=SourceRange, gallery:=xlLine(4), PlotBy:=xlColumns(default),
' -- categorylabels:=1, serieslabels:=0, HasLegend:=2, Title:="Company Stock Value"
crt.Chart.ChartWizard SourceRange, 4, , 2, 1, 0, 2, Request("co") & " Stock Value"
' -- Configure the Chart
crt.Chart.ChartType = xlLineMarkers
crt.Chart.SeriesCollection(1).Name = "Sheet1!R1C1"
crt.Chart.HasTitle = True
crt.Chart.Axes(1, 1).HasTitle = True
crt.Chart.Axes(1, 1).AxisTitle.Characters.Text = "Months"
crt.Chart.Axes(2, 1).HasTitle = True
crt.Chart.Axes(2, 1).AxisTitle.Characters.Text = "Stock Price"
' -- Determine the name to save this chart as. Use the current Seconds value, overwriting previous
' -- ones
mstrFileName = "junk" & Second(Now()) & ".jpg"
' -- Save the chart on web server
crt.Chart.Export Server.Mappath("/graficos/chartExcel2/") & "\" & mstrFileName, "jpg"
' -- Fool Excel into thinking the Workbook is saved
wb.Saved = True
' -- Set all objects back to nothing
Set crt = Nothing
Set wb = Nothing
' -- Quit Excel to conserve resources
xlapp.Quit
Set xlapp = Nothing
' -- Make sure the Image is not cached but is loaded fresh from the web server
Response.AddHeader "expires","0"
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control","no-cache"
End Sub
%> Tag: outlook folders Tag: 157102
integer ?
Hi
I need to use the "If" to check a number, I want to check a number i
an integer, if it isnt I want to go back and generate another numbe
if it is I want to leave the sub
This is a general description of what I am trying to do,
I have tried " If num <> Int Then ", But this doesnt work ca
anyone tell me the correct statement I should use
Thanks Tag: outlook folders Tag: 157098
Migrating Printers
I have zero experience with VB, and I have figured out a way to migrate printers by grabbing a couple of values from the Registry, but it doesnt work out so good if i use the whole key. can anyone help out with grabbing specific values from a machine and exporting them to a file such as "username.reg". TIA
REGEDIT
[HKEY_CURRENT_USER\Printers\Connections\,,sdprint1,HP4100TN-21
"Provider"="win32spl.dll
"Server"="\\\\sdprint1
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices
"\\\\sdprint1\\HP4100TN-21"="winspool,Ne04:
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts
"\\\\sdprint1\\HP4100TN-21"="winspool,Ne04:,15,45 Tag: outlook folders Tag: 157092
paste html code into excel cell?
Anybody can help me?, I need take an string that is HTML code and paste by
code into an excel cell. The code must be shown interpretate, thus in the
same way that if you go to the browser select a pieze of web page and select
copy, go to an excel book and paste it!, anybody have an idea?
Thanks Tag: outlook folders Tag: 157081
hi,
does anyone has a script to close and reconnect outlook personal folders?
thanks