|
-
Sep 6th, 2002, 02:40 AM
#1
Thread Starter
Fanatic Member
VB-script [resolved]
Whitch type of project do you need to start to create a VBS-file?
Last edited by robbedaya; Sep 7th, 2003 at 03:47 AM.
-
Sep 6th, 2002, 03:02 AM
#2
You can use Notepad! Just start a new doc up, enter this:
& save it as test.vbs. When you double click it, you'll see the code excecutes & you get the message pop up on your screen.
-
Sep 6th, 2002, 03:04 AM
#3
Thread Starter
Fanatic Member
-
Sep 6th, 2002, 04:34 AM
#4
Frenzied Member
If you want some more help for VB Script, this had some at some stage: http://www.vb-island.com/vbscript.php3
Or else, try these examples:
For example:
Set ww = Wscript.CreateObject(“Word.Document”)
ww.Application.DefaultSaveFormat = “”
MsgBox “Word 97 is now saving in its default format”
Send a message using Outlook:
set outL=WScript.CreateObject("Outlook.Application")
set mapi=outL.GetNameSpace("MAPI")
set email=outL.CreateItem(0)
email.Recipients.Add("[email protected]")
email.Subject = "Test"
email.Body = "Test"
email.Send
Set outL=Nothing
Set mapi=Nothing
List files in a folder:
set fso = wscript.createobject("Scripting.FileSystemObject")
set folder=fso.getFolder("C:\Temp")
i=1
For Each file In folder.Files
msgbox(i & ". " & file.name & vbcrlf)
i=i+1
next
Shell out to another application:
Dim wShell
Set wShell = WScript.CreateObject("WScript.Shell")
wShell.Run "notepad", 2
Set wShell = Nothing
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|