Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


VBScript/Outlook 2000 Question

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,38
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBScript/Outlook 2000 Question
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 VBScript/Outlook 2000 Question - 5/23/2001 7:46:43 AM   
  drkesrel

 

Posts: 11
Score: 0
Joined: 5/23/2001
From: USA
Status: offline
Hello again people,

Does anyone know how to extract a line of information from the body of an email in Outlook and place it in a targeted cell in an Excel worksheet? I'm trying to piece together a macro, but no dice so far =P
 
 
Post #: 1
 
 Re: VBScript/Outlook 2000 Question - 5/23/2001 7:49:06 AM   
  adminkoe

 

Posts: 117
Score: 0
Joined: 12/23/2000
From:
Status: offline
'This code should show you how to access Outlook 2000 and retrieve some data. Use defaultfolder #6 and go to the message body to retrieve the line.

Do you know how to open an Excel app via vbscript?


Set appOutl = Wscript.CreateObject("Outlook.Application")
Set objSession = appOutl.GetNameSpace("MAPI")
objSession.Logon Profile_Name_Here

' 3 = "Deleted Items"
' 4 = "Outbox"
' 5 = "Sent Items"
' 6 = "Inbox"
' 9 = "Calendar"
' 10 = "Contacts"
' 11 = "Journal"
' 12 = "Notes"
' 13 = "Tasks"
' 15 = "Reminders"
' 16 = "Drafts"

' *** INBOX folder
Set MyFolder = objSession.GetDefaultFolder(6)
Msgbox MyFolder.name & ", " & MyFolder.Items.Count

' Set MyItem to the collection of items in the folder.
Set myItems = myFolder.Items
' Loop through all of the items in the folder.
For I = 1 to MyFolder.Items.Count
MsgBox MyItems(I).subject
MsgBox MyItems(I).body
Next

' *** Contacts Folder
Set MyFolder = objSession.GetDefaultFolder(10)
Msgbox MyFolder.name & ", " & MyFolder.Items.Count
Set myItems = myFolder.Items.Restrict("[MessageClass] = 'IPM.Contact'")
For I = 1 to MyFolder.Items.Count
MsgBox MyItems(I).FullName
Next

(in reply to drkesrel)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBScript/Outlook 2000 Question Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts