> I am using Word 97.
>
[quoted text clipped - 16 lines]
>
> Can anyone assist, please.
Brilliant.
Many thanks
> '18 Nov 2004
> Private Sub TestSomething()
[quoted text clipped - 31 lines]
> >
> > Can anyone assist, please.
Adrain,
It doesn't like the split command!
It debugs saying sub or function not defined.
Any solutions?
Mark
> '18 Nov 2004
> Private Sub TestSomething()
[quoted text clipped - 31 lines]
> >
> > Can anyone assist, please.
Jonathan West - 19 Nov 2004 12:41 GMT
> Adrain,
>
[quoted text clipped - 3 lines]
>
> Any solutions?
Are you using Word 97?

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Adrian - 19 Nov 2004 13:03 GMT
So sorry, Mark! You did say you are using Word 97, which does not have the
Split() function.
> Adrain,
>
[quoted text clipped - 41 lines]
> > >
> > > Can anyone assist, please.
Helmut Weber - 19 Nov 2004 13:25 GMT
Hi everybody,
Hi Mark
you must be a very polite person,
as Jonathan's example is using split, too.
---
Sub test666()
Dim s As String
Dim p As Integer ' a position
s = "010.016.065.002"
p = InStr(s, ".")
s = Right(s, Len(s) - p)
p = InStr(s, ".")
s = Right(s, Len(s) - p)
p = InStr(s, ".")
s = Left(s, p - 1)
s = Format(s, "000")
MsgBox s
End Sub
Of course, this could be converted into a function.
You could even model your own split function with Word 97.
But if it is only an IP-adress...
---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
Adrian - 19 Nov 2004 13:17 GMT
OK, Mark... step through this code!
'18 Nov 2004
Private Sub TestSomething()
Dim sStrToSplit As String, sChr As String
Dim sReqdSection As String
Dim i As Integer, nDotCount As Integer
sStrToSplit = "010.016.65.002"
nDotCount = 1
For i = 1 To Len(sStrToSplit)
sChr = Mid$(sStrToSplit, i, 1)
If sChr = "." Then nDotCount = nDotCount + 1
'Set nDotCout to return required section
If nDotCount = 4 Then sReqdSection = sReqdSection & sChr
Next
If Left$(sReqdSection, 1) = "." Then sReqdSection = Mid$(sReqdSection, 2)
sReqdSection = Format(sReqdSection, "000")
End Sub
> Adrain,
>
[quoted text clipped - 5 lines]
>
> Mark