Im using VBA with word. Im fetching data via a search made on our internal page. As im not allowed to connect it to the mainframe im stuck with using the source code the searches provides. I have managed parse most of it.
But now I have a problem I can´t seem to solve..
When searching the database the string my parsing returns can have two formats.
First it can consist of a name made up of ONLY uppercase letters, this name have any position.
1. CARL Kristian Thor
2. Sture BERIT Stefan
3. Arne Pelle GÖSTA
4. Bengt PÄR
5. MOHAMMED Achmed
For this case i would like to transform the string into only the name made up of the uppercase letter i.e
1. CARL
2. BERIT
3. GÖSTA
4. PÄR
5. MOHAMMED
Secondly it can return, any given number of namnes but all names consist of uppercase.
1. Carl Kristian Thor
2. Sture berit Stefan
3. Arne Pelle Gösta
4. Bengt Pär
5. Mohammaed Achmed
For this case I want it as it is.
The code used for extracting this is
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
ie.Visible = False
ie.Navigate " & TextBox3.Value
start = 0
StopTime = 20000000
While start < StopTime
start = start + 1
Wend
numTDs = ie.Document.getElementsByTagName("td").Length
C = ie.Document.body.innerHTML
startnamn = InStr(1, C, "rnamn:") + 28
slutnamn = InStr(1, C, "Mellannamn:") - 37
namnet = Mid(C, startnamn, slutnamn - startnamn + 1)
Here i want a statement to change namnet into one of the two i described above.
Hope this isnt to troubling,
Cheers Carl
But now I have a problem I can´t seem to solve..
When searching the database the string my parsing returns can have two formats.
First it can consist of a name made up of ONLY uppercase letters, this name have any position.
1. CARL Kristian Thor
2. Sture BERIT Stefan
3. Arne Pelle GÖSTA
4. Bengt PÄR
5. MOHAMMED Achmed
For this case i would like to transform the string into only the name made up of the uppercase letter i.e
1. CARL
2. BERIT
3. GÖSTA
4. PÄR
5. MOHAMMED
Secondly it can return, any given number of namnes but all names consist of uppercase.
1. Carl Kristian Thor
2. Sture berit Stefan
3. Arne Pelle Gösta
4. Bengt Pär
5. Mohammaed Achmed
For this case I want it as it is.
The code used for extracting this is
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
ie.Visible = False
ie.Navigate " & TextBox3.Value
start = 0
StopTime = 20000000
While start < StopTime
start = start + 1
Wend
numTDs = ie.Document.getElementsByTagName("td").Length
C = ie.Document.body.innerHTML
startnamn = InStr(1, C, "rnamn:") + 28
slutnamn = InStr(1, C, "Mellannamn:") - 37
namnet = Mid(C, startnamn, slutnamn - startnamn + 1)
Here i want a statement to change namnet into one of the two i described above.
Hope this isnt to troubling,
Cheers Carl