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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving data to file, send as e-mail body, extract data -LOGIC or Ideas 1

Status
Not open for further replies.

x508

Programmer
Jun 26, 2003
396
ZA
Hi all.

I am looking to do the following:

My app has an extension which will be run on a variety of different geographical areas. When this extension is used, I will write a comma Sep e-mial body and send it to the main app. The email body will then be copied into a form on the main app, which will extract the appropriate data from the comma sep string (I hope)

Any ideas or suggestions will be appreciated

**********************************
May the Code Be With You...
----------
x50-8 (X Fifty Eigt)
 
You have the body of the email with commas. This code will get the body of the email into a string.

Dim ol As Outlook.Application
Set ol = CreateObject("Outlook.Application")
Dim fd As Outlook.MAPIFolder
Set myFolder = ol.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)

Dim ns As Outlook.NameSpace
Dim itms As Outlook.Items
Dim itm As Object

'Get to the current session of Outlook
Set ns = ol.GetNamespace("MAPI")

'Retrieve a collection of mail messages in the Inbox
Set itms = ns.GetDefaultFolder(olFolderInbox).Items

'Loop through the items and display the subjects of the unread
'messages in a spreadsheet
For Each itm In itms
If Left(itm.Subject, 26) = "Subject" Then
Cells(1, 4).Value = itm.Subject
b = itm.Body
End If

sp = ","
i = 0
bo = Split(b, sp)
l = UBound(bo)

Next


This program will get the body of the email into the string b and then splits it up into an array bo with the separator ",".

Hope this hopes. Let me know

dyarwood
 
Thanks wood. This will definately help but...

What I am actually looking for is ideas or suggestions on my current technique to get data from extension app to main app

Thanks

**********************************
May the Code Be With You...
----------
x50-8 (X Fifty Eigt)
 
AS I understand you are sending the data from one app to the main one via email. If the email has a standard layout use the above code to get the body of it into an array. Once there you can take parts of the bo array and put them in text boxes.

eg if you had the following

text1.text = bo(3)

and bo(3) was the text from the email going into the text box.

Have I understood the problem properly?
 
No raally, lol

I am only contemplating on how I will do the whole thing.

I'm "planning" to use e-mail to send the data, and planning all the rest.

What I would like are opinions on what I am contemplating (i.e. is it effective, is there a better/other way etc. ) and ideas or suggestions on if their might be a better way to interact with data between two apps of geographical difference

Thanks for yar trouble

**********************************
May the Code Be With You...
----------
x50-8 (X Fifty Eigt)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top