17. oktober 2018 - 13:14Der er
13 kommentarer og 1 løsning
Data sendt til email
Hej -
Jeg har en database hvor data løbende blive sendt pr. mail. Strukturen i mailen skal være [kampID]-[hjemmeholdsscore]-[udeholdsscore]-[hjemmeholdsmål]-[udeholdsmål]
"Jeg har en database hvor data løbende blive sendt pr. mail." Does this mean that you are already sending emails "løbende" or does it mean you want to ?
Perhaps you should explain in more detail, what you have already and what you want. Thanks
Ok - jeg prøver på dansk. Lige nu har jeg en database med en resultattabel, som jeg opdaterer manuelt.
I stedet for manuel opdatering ville jeg gerne hvis tabellen blev opdateret, når der kom nye indberetning via mail. Hvad der sker med data efterfølgende er ikke så vigtigt
There is no VBA code for a finished solution as its specific for your requirements which I'm afraid to say are still unclear :-(
I still dont know if your are receiving the mail with data or sending the mail with data, or which system you are using to receive/send, Outlook for example.
So I would like you to describe what you want in more detail, step by step so we can better understand what needs to be made.
Once we know what needs to be made its easier to say if we can help or not.
The situation is that I would like resultat send to me on mails. The content header of the mail holds the information eg. [gameID]-[score1]-[score2]-[score3]-[score4] for each game.
The result is to loaded into an access tabel, which have the same 5 columns. The gameID is uniq.
You stil haven't said which mail system you are using :-(
This VBA Code is for Outlook, anything else then you need to look elsewhere ;-)
In your Inbox you need a folder named Scores and another named Finished You also need to set a filer up so that mails with the data you are receiving gets moved to Scores. The Finished folder is for that that have been processed.
At the moment all we do is write the data to the debug window, and the data is in the body.
Once you get this working we can take it a step further :-)
Function SaveScore() Dim myApp As New Outlook.Application Dim myNameSpace As Outlook.NameSpace Dim myFolder As Outlook.MAPIFolder Dim myAflsuttetFolder As Outlook.MAPIFolder Dim myMsg As Outlook.MailItem Dim a As Integer
Set myApp = CreateObject("Outlook.Application") Set myNameSpace = myApp.GetNamespace("MAPI") Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
Set myWorkingFolder = myFolder.Folders("Scores")
Set myFinishedFolder = myFolder.Folders("Finished")
For Each myMsg In myWorkingFolder.Items With myMsg
Debug.Print Trim(myMsg.Body)
myMsg.Move myFinishedFolder
End With Next
Set myMsg = Nothing Set myFinishedFolder = Nothing Set myWorkingFolder = Nothing Set myNameSpace = Nothing Set myApp = Nothing
Well I think it would be one of the first things you need to find out before we go any further.
Synes godt om
1 synes godt om dette
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.