Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transfer data from Outlook2000 custom form to custom Excel sheet

Status
Not open for further replies.

sbauerle

Technical User
Mar 14, 2002
17
DE
Hello,

because of printing issues of custom Outlook forms, I would like to transfer the data from the Outlook2000 form to an Excel sheet using VBscript.
Something like:

Sub Transfer_Click
'*** open custom Excel sheet
'*** copy/transfer data from Outlook to Excel
End Sub

Any help would be great
thanks
Stefan
 
best i can offer, sorry


set appXL = Wscript.CreateObject("Excel.Application")
appXL.Visible = False


set objSession = CreateObject("MAPI.Session")
objSession.Logon "blaa" 'profile name
set objInbox=objSession.Inbox.Messages

for each objMessage in objInbox
if objMessage.Sender = "x@.com" then
strMessage = objMessage.Body
appXL.Workbooks.Open("c:\test.xls")
appXL.ActiveSheet.Range("A1").Value = strMessage



end if

next


the above will work in thoery. if you dont want to get into reading messages with CDO then you could try creating an outlook object as follows

set WshShell = CreateObject("WScript.Shell")
set outApp = Wscript.CreateObject("Outlook.Application")

once you have done that you can probably refer to the outlook vba refernce material to get the methods and properties to retrieve what you want.
regards,
Richard
 
Thanks a lot. That helped me a lot. It works now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top