Background: This beast of a problem came about when an Outlook Contacts folder was exported to a Table in Access. Since Outlook allows for muliple lines in the "Address" field, the information doesn't make sense in Access, which only allows single line input. So, I've written the following code:
Sub Macro69()
Dim Mystring As String, MyArray, Msg, x As Integer
Dim iLP As Integer
DoCmd.OpenForm "Outlook1"
Mystring = Forms!Outlook1!Address1
MyArray = Split(Mystring, "*", -1, 1)
For iLP = LBound(MyArray) To UBound(MyArray)
Msg = MyArray(iLP)
MsgBox Msg
Next iLP
'x = Asc(Mid(Mystring, 22, 1))
'MsgBox x
End Sub
What I did to test the little bugger was edit the exported "Address" and put in a "*" between the text so my Address field looked like
Euro*Canadian Center|Marlborough Street
which returns
Euro (...1 field)
Canadian Center
Marlborough Street (...2&3 lines 1 field)
So here's my dilema. In the line "...Center|Marlborough..." the "|" is a character generated from Outlook(I'm guessing it's like a CR since Marlborough is displayed as a new line) I've identified the characters' ASCII equivalent = 10. In the line
MyArray = Split(Mystring, "*", -1, 1)
how would I replace the "*" with the ASCII reference? If this is possible what I'll have is the muti-line Address parsed into 3 seperate fields and life would be good!
Sub Macro69()
Dim Mystring As String, MyArray, Msg, x As Integer
Dim iLP As Integer
DoCmd.OpenForm "Outlook1"
Mystring = Forms!Outlook1!Address1
MyArray = Split(Mystring, "*", -1, 1)
For iLP = LBound(MyArray) To UBound(MyArray)
Msg = MyArray(iLP)
MsgBox Msg
Next iLP
'x = Asc(Mid(Mystring, 22, 1))
'MsgBox x
End Sub
What I did to test the little bugger was edit the exported "Address" and put in a "*" between the text so my Address field looked like
Euro*Canadian Center|Marlborough Street
which returns
Euro (...1 field)
Canadian Center
Marlborough Street (...2&3 lines 1 field)
So here's my dilema. In the line "...Center|Marlborough..." the "|" is a character generated from Outlook(I'm guessing it's like a CR since Marlborough is displayed as a new line) I've identified the characters' ASCII equivalent = 10. In the line
MyArray = Split(Mystring, "*", -1, 1)
how would I replace the "*" with the ASCII reference? If this is possible what I'll have is the muti-line Address parsed into 3 seperate fields and life would be good!