Off-topic Talk Where overpaid, underworked S2000 owners waste the worst part of their days before the drive home. This forum is for general chit chat and discussions not covered by the other off-topic forums.

VB Script/WSH/Progammer ... Help!!

Thread Tools
 
Old Mar 2, 2004 | 11:26 AM
  #1  
QT_S2K's Avatar
Thread Starter
Registered User
 
Joined: May 2002
Posts: 1,147
Likes: 1
From: Houston
Default VB Script/WSH/Progammer ... Help!!

Got a request for you guru out there.

Situation: I need to export (or save) the body text of email(s) in a specified folder to one text file located somewhere on the network. The catch is I need to do this in a script that can be scheduled as a task to be perform on a daily basis.

Current resolution: I have currently a VB program to do this, but it requires that I'm logged on before the GUI will work.

What I'm thinking is, I can first initally setup my Outlook profile to create the necessary reg keys that I will need for the script to identify what profile it needs to extract the text from. I'm also thinking of either using CDO or COM objects to accomplish this.

If anyone could point me to the right direction to do this, I would appreciate it.

thanks,
Reply
Old Mar 2, 2004 | 11:44 AM
  #2  
slh7d's Avatar
Registered User
 
Joined: Feb 2004
Posts: 160
Likes: 0
From: Chahassen
Default

the emails are in someones Exchange folder, in their INBOX?
Reply
Old Mar 2, 2004 | 11:45 AM
  #3  
cyber_x's Avatar
Registered User
 
Joined: Jun 2002
Posts: 4,096
Likes: 0
From: SF Bay Area
Default

Would it be feasible to use a NT service? Your Win32 GUI app needs to run within the context of the logged-on user, but a service wouldn't.
Reply
Old Mar 2, 2004 | 11:52 AM
  #4  
slh7d's Avatar
Registered User
 
Joined: Feb 2004
Posts: 160
Likes: 0
From: Chahassen
Default

If the emails you want to extract are in Outlook,

vbscript has a "outlook" library. you should be able to extract al you need using this library.

its "Outlook.Application" , so create an object using that library, and you should be able to access email text....hopefully

Check web for examples....

the VB program, if you have the source code, could probably be easily modified so it wouldnt need the GUI.
Reply
Old Mar 2, 2004 | 11:55 AM
  #5  
cyber_x's Avatar
Registered User
 
Joined: Jun 2002
Posts: 4,096
Likes: 0
From: SF Bay Area
Default

Also, the Office controls in VB are already COM objects, so you wouldn't need to implement your own. There's full docs on them in the *.CHM files that come with Office.
Reply
Old Mar 2, 2004 | 12:09 PM
  #6  
QT_S2K's Avatar
Thread Starter
Registered User
 
Joined: May 2002
Posts: 1,147
Likes: 1
From: Houston
Default

[QUOTE]Originally posted by slh7d
If the emails you want to extract are in Outlook,

vbscript has a "outlook" library.
Reply
Old Mar 2, 2004 | 12:13 PM
  #7  
cyber_x's Avatar
Registered User
 
Joined: Jun 2002
Posts: 4,096
Likes: 0
From: SF Bay Area
Default

QT_S2K,

Out of curiosity, is this something that needs to run before an user has logged in to Windows?
Reply
Old Mar 2, 2004 | 03:35 PM
  #8  
no_really's Avatar
Banned
 
Joined: Dec 2003
Posts: 3,319
Likes: 0
From: City
Default

Rewrite the exe to run without a GUI. Don't make any controls or require run-time input, and use command-line args or a text file for any input you need. Run it as a scheduled system task, and that should be that.

There are several ways to do this. If you already have the whole thing worked out, just remove the GUI references in your exe. I'm sure there is something more to do - like a compiler command, so I am gonna play with it right now.
Reply
Old Mar 2, 2004 | 07:12 PM
  #9  
jankemi's Avatar
 
Joined: Oct 2003
Posts: 528
Likes: 0
From: St Paul
Default

Sounds like someone is writing a worm.
Reply
Old Mar 3, 2004 | 03:17 AM
  #10  
QT_S2K's Avatar
Thread Starter
Registered User
 
Joined: May 2002
Posts: 1,147
Likes: 1
From: Houston
Default

Originally posted by cyber_x
QT_S2K,

Out of curiosity, is this something that needs to run before an user has logged in to Windows?
All this script needs to do is to export about 30 or so emails from my profile to a text file, from there I already have another script that will open the text file and go through and see what backups failed and other stuff.

But, I would prefer this to be a scheduled task with a login id that the script knows to export the emails from. OR I can put this in as a GPO startup script/startup folder and all I have to do then is just login. But, I'm trying to do all of this automatically, so that when I get into work the report is done.
Reply



All times are GMT -8. The time now is 06:37 PM.