Morning All
I have been everywhere for months and cannot get to the bottom of the following problem
Scenrio: Currently get requirements from the business via a request in the shape of a table (excel) that is imported into an Access DB.
Our company is currently moving to win10/office 365 and i want to get our request system updated via small steps in the right direction.
I basically want requests to come in via email instead and an AccessDB will import these emails, parse them, then do as they need to similar to imported excel tables.
Other problem i have is - with moving to win10 - the code i write needs to work on win7/office 2016 and win10/office365.
The current code works fine in Access2016 on win7 but fails on win10/office365
current code (which is just test code to make sure the right data is being grabbed)
the code fails on the red lines.... the third msgbox has had soooo many different code types and references....
anyone able to point me in the right direction.
I have been everywhere for months and cannot get to the bottom of the following problem
Scenrio: Currently get requirements from the business via a request in the shape of a table (excel) that is imported into an Access DB.
Our company is currently moving to win10/office 365 and i want to get our request system updated via small steps in the right direction.
I basically want requests to come in via email instead and an AccessDB will import these emails, parse them, then do as they need to similar to imported excel tables.
Other problem i have is - with moving to win10 - the code i write needs to work on win7/office 2016 and win10/office365.
The current code works fine in Access2016 on win7 but fails on win10/office365
current code (which is just test code to make sure the right data is being grabbed)
Code:
Private Sub Command4_Click()
Dim outlookApp As Outlook.Application
Dim OutlookNamespace As NameSpace
Dim Folder As MAPIFolder
Dim OutlookMail As Variant
Dim i As Integer
Set outlookApp = New Outlook.Application
Set OutlookNamespace = outlookApp.GetNamespace("MAPI")
Set Folder = OutlookNamespace.GetDefaultFolder(olFolderInbox).Folders("Import")
i = 1
For Each OutlookMail In Folder.Items
If OutlookMail.SenderEmailType = "SMTP" Then
one = MsgBox(OutlookMail.Subject, vbOKOnly, "1")
two = MsgBox(OutlookMail.ReceivedTime, vbOKOnly, "2")
three = MsgBox(OutlookMail.SenderEmailAddress, vbOKOnly, "3")
four = MsgBox(OutlookMail.Body, vbOKOnly, "4")
Else
one = MsgBox(OutlookMail.Subject, vbOKOnly, "1")
two = MsgBox(OutlookMail.ReceivedTime, vbOKOnly, "2")
three = MsgBox(OutlookMail.Sender.GetExchangeUser().PrimarySmtpAddress, vbOKOnly, "3")
four = MsgBox(OutlookMail.Body, vbOKOnly, "4")
End If
i = i + 1
Next OutlookMail
Set Folder = Nothing
Set OutlookNamespace = Nothing
Set outlookApp = Nothing
End Sub
the code fails on the red lines.... the third msgbox has had soooo many different code types and references....
anyone able to point me in the right direction.