hey guys!
I'd like to crate a vbs script which could load specific data from a file..
name, lastname, e-mail
e.g.
john, smith, world, john@world.com
and so on..
and then create a new contact in outlook application using those values.
To create a new contact i could you sth like this:
Const olContactItem = 2a
Dim objOutl, objContact
Set objOutl = WScript.CreateObject("Outlook.Application")
Set objContact = objOutl.CreateItem(olContactItem)
objContact.FirstName = "john"
objContact.LastName = "smith"
objContact.Email1Address = "john@world.com"
objContact.Save()
But i'm not able to create a procedure which could load that data from a file, could you please help me with that.
Jack
VBScript - load a data from a file and create a new Outlook contact!
|
Newbie Member
|
|
| 31Aug2006,17:41 | #1 |
|
Team Leader
|
![]() |
| 1Sep2006,10:57 | #2 |
|
Here is a simple solution to the problem.
Code: VB
|
|
Newbie Member
|
|
| 1Sep2006,14:04 | #3 |
|
Quote:
Originally Posted by pradeep just one thing, when im trying to run it, i got an error: "Expected end of statement" so i removed 'a' from ' Const olContactItem = 2a' then i got an error: "Invalid procedure call or argument" in this line: "Set oTF = oFSO.OpenTextFile(InpFile,ForReading,True)" i tried to add 'Option Explicit' but then i get: "variable is undefined: 'For Reading''" ... |
|
Newbie Member
|
|
| 17Sep2006,01:23 | #4 |
|
You need to include the library with the constant definitions the post here
http://p2p.wrox.com/archive/beginnin...2002-06/53.asp explains. the line you need to add goes before the <head> it should read : <!-- METADATA TYPE=3D"typelib" FILE=3D"C:\windows\system32\scrrun.dll" --> Note: the location of scrrun.dll may differ and is system dependant. Dale |
|
Newbie Member
|
|
| 7Oct2006,00:00 | #5 |
|
I'd like to do the same thing but also create some distribution lists at the same time. I am a complete newbie when it comes to this- can I drop that code (listed above) in a .wsf file and run it from the commandline?
Also, when I looked at the library to include, it seems you are including it as it would be on a webpage- I assume the syntax would be completely different in a .wsf file on a local machine, but have no clue what that syntax would be. Any help would be greatly appreciated, Thanks -Tom |

