Hi folks,

Sorta a followon from my "on focus clipboard" message.

I want to parse the data on the clipboard into textbox of a userform.

The data looks like:

Pers ID: 20456035839 Master RNS: 5476121
(Real) SMITH, MICHAEL JOHN

(Contact Address) 8 FORD ROAD, WHITTAMS, AUCKLAND CITY 1750



I had a go myself and ended up hardcoding everyting - it was pretty ugly.



lines like

RNS = Mid(clipbd_string, InStr(clipbd_string, "Master RNS: ") + Len("Master
RNS: "), 8) 'RNS max length is 8

Surname_name = Mid(clipbd_string, 52, (InStr(clipbd_string, ",") - 52))

Anyone have any better ideas?



-Al








-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----

Re: Parsing string on clipboard by Peter

Peter
Fri Aug 27 10:09:55 CDT 2004

Hi Al Grant

If you're using Word 2000 or later there are a few useful functions you can use: Replace,
Split, Join. As long as your input data is consistent you can probably get away with
simple parsing rather than resorting to much more complex token matching parsing.

You can do something simple like this:

Public Sub ParseClipboarData()
Dim str1 As String
Dim str2 As String
Dim str3 As String
Dim strId As String
Dim strRNS As String
Dim strName As String
Dim strAddress As String
Dim strWork() As String

str1 = "Pers ID: 20456035839 Master RNS: 5476121"
str2 = "(Real) SMITH, MICHAEL JOHN"
str3 = "(Contact Address) 8 FORD ROAD, WHITTAMS, AUCKLAND CITY 1750"

' Parse out the first line
strWork() = Split(str1, " ")
strId = Trim$(strWork(2))
strRNS = Trim$(strWork(5))

' Parse out the second line
strWork() = Split(str2, ")")
strName = Trim$(strWork(1))

' Reverse the name and remove the comma
strWork() = Split(strName, ",")
strName = Trim$(strWork(1)) & " " & strWork(0)

' Parse out the third line
strWork() = Split(str3, ")")
strAddress = Trim$(strWork(1))
End Sub

It's mostly declarations but is straightforward.

HTH + Cheers - Peter


"Al Grant" <acgrant@orcon.net.nz>, said:

>Hi folks,
>
>Sorta a followon from my "on focus clipboard" message.
>
>I want to parse the data on the clipboard into textbox of a userform.
>
>The data looks like:
>
>Pers ID: 20456035839 Master RNS: 5476121
>(Real) SMITH, MICHAEL JOHN
>
>(Contact Address) 8 FORD ROAD, WHITTAMS, AUCKLAND CITY 1750
>
>
>
>I had a go myself and ended up hardcoding everyting - it was pretty ugly.
>
>
>
>lines like
>
>RNS = Mid(clipbd_string, InStr(clipbd_string, "Master RNS: ") + Len("Master
>RNS: "), 8) 'RNS max length is 8
>
>Surname_name = Mid(clipbd_string, 52, (InStr(clipbd_string, ",") - 52))
>
>Anyone have any better ideas?
>
>
>
>-Al
>
>
>
>
>
>
>
>
>-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
>http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
>-----== Over 100,000 Newsgroups - 19 Different Servers! =-----


Re: Parsing string on clipboard by Helmut

Helmut
Fri Aug 27 14:26:08 CDT 2004

Hi Al,
this is the part, which Peter took for granted:
---
Dim oDat As DataObject
Dim sAll As String
Set oDat = New DataObject
oDat.GetFromClipboard
On Error GoTo TheEnd
sAll = oDat.GetText
MsgBox sAll
Exit Sub
TheEnd:
MsgBox "No text in Clipboard"
---
Greetings from Bavaria, Germany
Helmut Weber
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98


Re: Parsing string on clipboard by Peter

Peter
Fri Aug 27 19:42:21 CDT 2004

Hi Helmut Weber

No I didn't - you'd already posted the code in the previous thread! And Al's definitely
smart enough to do the integration.

Cheers - Peter


Helmut Weber <elmkqznfwvccbf@mailinator.com>, said:

>Hi Al,
>this is the part, which Peter took for granted:
>---
>Dim oDat As DataObject
>Dim sAll As String
>Set oDat = New DataObject
>oDat.GetFromClipboard
>On Error GoTo TheEnd
>sAll = oDat.GetText
>MsgBox sAll
>Exit Sub
>TheEnd:
>MsgBox "No text in Clipboard"
>---
>Greetings from Bavaria, Germany
>Helmut Weber
>"red.sys" & chr(64) & "t-online.de"
>Word XP, Win 98

HTH + Cheers - Peter


Re: Parsing string on clipboard by Al

Al
Sat Aug 28 16:30:36 CDT 2004

Yep, I guess I have to seperate out sALL into str1, str2, str3.

Will have a crack at it later. Thanks guys.

-Al

"Peter Hewett" <nospam@xtra.co.nz> wrote in message
news:65lvi0lcdvcuj4lrmiu6nolqb58tv8tsb8@4ax.com...
> Hi Helmut Weber
>
> No I didn't - you'd already posted the code in the previous thread! And
Al's definitely
> smart enough to do the integration.
>
> Cheers - Peter
>
>
> Helmut Weber <elmkqznfwvccbf@mailinator.com>, said:
>
> >Hi Al,
> >this is the part, which Peter took for granted:
> >---
> >Dim oDat As DataObject
> >Dim sAll As String
> >Set oDat = New DataObject
> >oDat.GetFromClipboard
> >On Error GoTo TheEnd
> >sAll = oDat.GetText
> >MsgBox sAll
> >Exit Sub
> >TheEnd:
> >MsgBox "No text in Clipboard"
> >---
> >Greetings from Bavaria, Germany
> >Helmut Weber
> >"red.sys" & chr(64) & "t-online.de"
> >Word XP, Win 98
>
> HTH + Cheers - Peter
>




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----

Re: Parsing string on clipboard by Al

Al
Sat Aug 28 16:37:04 CDT 2004

Hmmm - I cant find dataobject as a type of variable, and I get a compile
error - user-defined type not defined???

-Al


"Peter Hewett" <nospam@xtra.co.nz> wrote in message
news:65lvi0lcdvcuj4lrmiu6nolqb58tv8tsb8@4ax.com...
> Hi Helmut Weber
>
> No I didn't - you'd already posted the code in the previous thread! And
Al's definitely
> smart enough to do the integration.
>
> Cheers - Peter
>
>
> Helmut Weber <elmkqznfwvccbf@mailinator.com>, said:
>
> >Hi Al,
> >this is the part, which Peter took for granted:
> >---
> >Dim oDat As DataObject
> >Dim sAll As String
> >Set oDat = New DataObject
> >oDat.GetFromClipboard
> >On Error GoTo TheEnd
> >sAll = oDat.GetText
> >MsgBox sAll
> >Exit Sub
> >TheEnd:
> >MsgBox "No text in Clipboard"
> >---
> >Greetings from Bavaria, Germany
> >Helmut Weber
> >"red.sys" & chr(64) & "t-online.de"
> >Word XP, Win 98
>
> HTH + Cheers - Peter
>




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----

Re: Parsing string on clipboard by Jay

Jay
Sat Aug 28 17:27:51 CDT 2004

Hi Al,

In the VBA editor, go to the Tools > References dialog and check the
box next to Microsoft Forms 2.0 Object Library. That will make the
DataObject available. You'll have to repeat this in each template
project where you want to use a DataObject.

--
Regards,
Jay Freedman http://aspnet2.com/mvp.ashx?JayFreedman
Microsoft Word MVP FAQ: http://word.mvps.org

"Al Grant" <acgrant@orcon.net.nz> wrote:

>Hmmm - I cant find dataobject as a type of variable, and I get a compile
>error - user-defined type not defined???
>
>-Al
>
>
>"Peter Hewett" <nospam@xtra.co.nz> wrote in message
>news:65lvi0lcdvcuj4lrmiu6nolqb58tv8tsb8@4ax.com...
>> Hi Helmut Weber
>>
>> No I didn't - you'd already posted the code in the previous thread! And
>Al's definitely
>> smart enough to do the integration.
>>
>> Cheers - Peter
>>
>>
>> Helmut Weber <elmkqznfwvccbf@mailinator.com>, said:
>>
>> >Hi Al,
>> >this is the part, which Peter took for granted:
>> >---
>> >Dim oDat As DataObject
>> >Dim sAll As String
>> >Set oDat = New DataObject
>> >oDat.GetFromClipboard
>> >On Error GoTo TheEnd
>> >sAll = oDat.GetText
>> >MsgBox sAll
>> >Exit Sub
>> >TheEnd:
>> >MsgBox "No text in Clipboard"
>> >---
>> >Greetings from Bavaria, Germany
>> >Helmut Weber
>> >"red.sys" & chr(64) & "t-online.de"
>> >Word XP, Win 98
>>
>> HTH + Cheers - Peter
>>
>
>
>
>
>-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
>http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
>-----== Over 100,000 Newsgroups - 19 Different Servers! =-----


Re: Parsing string on clipboard by Al

Al
Sun Aug 29 02:05:23 CDT 2004

Hmmm, I am getting closer with:

Public Sub ParseClipboarData()
Dim str1 As String
Dim str2 As String
Dim str3 As String
Dim strId As String
Dim strRNS As String
Dim strName As String
Dim strAddress As String
Dim strWork() As String

xstart = 1
str1 = Mid(sAll, xstart, InStr(xstart, sAll, Chr(13)))
MsgBox testval1
xstart = InStr(xstart, sAll, Chr(13)) + 2
str2 = Mid(sAll, xstart, InStr(xstart, sAll, Chr(13)) - xstart)
MsgBox testval2

but I still think their is a better way to increment xstart, rather than
line by line?

Cheers

-Al

"Jay Freedman" <jay.freedman@verizon.net> wrote in message
news:hj12j09umv32hr4v6970gf4dq3eefsakhp@4ax.com...
> Hi Al,
>
> In the VBA editor, go to the Tools > References dialog and check the
> box next to Microsoft Forms 2.0 Object Library. That will make the
> DataObject available. You'll have to repeat this in each template
> project where you want to use a DataObject.
>
> --
> Regards,
> Jay Freedman http://aspnet2.com/mvp.ashx?JayFreedman
> Microsoft Word MVP FAQ: http://word.mvps.org
>
> "Al Grant" <acgrant@orcon.net.nz> wrote:
>
> >Hmmm - I cant find dataobject as a type of variable, and I get a compile
> >error - user-defined type not defined???
> >
> >-Al
> >
> >
> >"Peter Hewett" <nospam@xtra.co.nz> wrote in message
> >news:65lvi0lcdvcuj4lrmiu6nolqb58tv8tsb8@4ax.com...
> >> Hi Helmut Weber
> >>
> >> No I didn't - you'd already posted the code in the previous thread!
And
> >Al's definitely
> >> smart enough to do the integration.
> >>
> >> Cheers - Peter
> >>
> >>
> >> Helmut Weber <elmkqznfwvccbf@mailinator.com>, said:
> >>
> >> >Hi Al,
> >> >this is the part, which Peter took for granted:
> >> >---
> >> >Dim oDat As DataObject
> >> >Dim sAll As String
> >> >Set oDat = New DataObject
> >> >oDat.GetFromClipboard
> >> >On Error GoTo TheEnd
> >> >sAll = oDat.GetText
> >> >MsgBox sAll
> >> >Exit Sub
> >> >TheEnd:
> >> >MsgBox "No text in Clipboard"
> >> >---
> >> >Greetings from Bavaria, Germany
> >> >Helmut Weber
> >> >"red.sys" & chr(64) & "t-online.de"
> >> >Word XP, Win 98
> >>
> >> HTH + Cheers - Peter
> >>
> >
> >
> >
> >
> >-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> >http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> >-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
>




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----

Re: Parsing string on clipboard by Peter

Peter
Sun Aug 29 02:39:57 CDT 2004

Hi Al Grant

An earlier post in this thread uses Split so why not use that:

Dim astrLines() as String

astrLines() = Split(sAll, Chr$(13))

then replace str1 with astrLines(0) , str2 with astrLines(1), etc.

HTH + Cheers - Peter


"Al Grant" <acgrant@orcon.net.nz>, said:

>Hmmm, I am getting closer with:
>
>Public Sub ParseClipboarData()
> Dim str1 As String
> Dim str2 As String
> Dim str3 As String
> Dim strId As String
> Dim strRNS As String
> Dim strName As String
> Dim strAddress As String
> Dim strWork() As String
>
>xstart = 1
>str1 = Mid(sAll, xstart, InStr(xstart, sAll, Chr(13)))
>MsgBox testval1
>xstart = InStr(xstart, sAll, Chr(13)) + 2
>str2 = Mid(sAll, xstart, InStr(xstart, sAll, Chr(13)) - xstart)
>MsgBox testval2
>
>but I still think their is a better way to increment xstart, rather than
>line by line?
>
>Cheers
>
>-Al
>
>"Jay Freedman" <jay.freedman@verizon.net> wrote in message
>news:hj12j09umv32hr4v6970gf4dq3eefsakhp@4ax.com...
>> Hi Al,
>>
>> In the VBA editor, go to the Tools > References dialog and check the
>> box next to Microsoft Forms 2.0 Object Library. That will make the
>> DataObject available. You'll have to repeat this in each template
>> project where you want to use a DataObject.
>>
>> --
>> Regards,
>> Jay Freedman http://aspnet2.com/mvp.ashx?JayFreedman
>> Microsoft Word MVP FAQ: http://word.mvps.org
>>
>> "Al Grant" <acgrant@orcon.net.nz> wrote:
>>
>> >Hmmm - I cant find dataobject as a type of variable, and I get a compile
>> >error - user-defined type not defined???
>> >
>> >-Al
>> >
>> >
>> >"Peter Hewett" <nospam@xtra.co.nz> wrote in message
>> >news:65lvi0lcdvcuj4lrmiu6nolqb58tv8tsb8@4ax.com...
>> >> Hi Helmut Weber
>> >>
>> >> No I didn't - you'd already posted the code in the previous thread!
>And
>> >Al's definitely
>> >> smart enough to do the integration.
>> >>
>> >> Cheers - Peter
>> >>
>> >>
>> >> Helmut Weber <elmkqznfwvccbf@mailinator.com>, said:
>> >>
>> >> >Hi Al,
>> >> >this is the part, which Peter took for granted:
>> >> >---
>> >> >Dim oDat As DataObject
>> >> >Dim sAll As String
>> >> >Set oDat = New DataObject
>> >> >oDat.GetFromClipboard
>> >> >On Error GoTo TheEnd
>> >> >sAll = oDat.GetText
>> >> >MsgBox sAll
>> >> >Exit Sub
>> >> >TheEnd:
>> >> >MsgBox "No text in Clipboard"
>> >> >---
>> >> >Greetings from Bavaria, Germany
>> >> >Helmut Weber
>> >> >"red.sys" & chr(64) & "t-online.de"
>> >> >Word XP, Win 98
>> >>
>> >> HTH + Cheers - Peter
>> >>
>> >
>> >
>> >
>> >
>> >-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
>> >http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
>> >-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
>>
>
>
>
>
>-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
>http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
>-----== Over 100,000 Newsgroups - 19 Different Servers! =-----


Re: Parsing string on clipboard by Al

Al
Sun Aug 29 20:05:31 CDT 2004

After getting it working on my pc at home I found out we are on office 97 at
work!!!

No split command :-(

-Al

"Peter Hewett" <nospam@xtra.co.nz> wrote in message
news:er13j0p9srss8t7a0v41772j1ngu4h50p9@4ax.com...
> Hi Al Grant
>
> An earlier post in this thread uses Split so why not use that:
>
> Dim astrLines() as String
>
> astrLines() = Split(sAll, Chr$(13))
>
> then replace str1 with astrLines(0) , str2 with astrLines(1), etc.
>
> HTH + Cheers - Peter
>
>
> "Al Grant" <acgrant@orcon.net.nz>, said:
>
> >Hmmm, I am getting closer with:
> >
> >Public Sub ParseClipboarData()
> > Dim str1 As String
> > Dim str2 As String
> > Dim str3 As String
> > Dim strId As String
> > Dim strRNS As String
> > Dim strName As String
> > Dim strAddress As String
> > Dim strWork() As String
> >
> >xstart = 1
> >str1 = Mid(sAll, xstart, InStr(xstart, sAll, Chr(13)))
> >MsgBox testval1
> >xstart = InStr(xstart, sAll, Chr(13)) + 2
> >str2 = Mid(sAll, xstart, InStr(xstart, sAll, Chr(13)) - xstart)
> >MsgBox testval2
> >
> >but I still think their is a better way to increment xstart, rather than
> >line by line?
> >
> >Cheers
> >
> >-Al
> >
> >"Jay Freedman" <jay.freedman@verizon.net> wrote in message
> >news:hj12j09umv32hr4v6970gf4dq3eefsakhp@4ax.com...
> >> Hi Al,
> >>
> >> In the VBA editor, go to the Tools > References dialog and check the
> >> box next to Microsoft Forms 2.0 Object Library. That will make the
> >> DataObject available. You'll have to repeat this in each template
> >> project where you want to use a DataObject.
> >>
> >> --
> >> Regards,
> >> Jay Freedman http://aspnet2.com/mvp.ashx?JayFreedman
> >> Microsoft Word MVP FAQ: http://word.mvps.org
> >>
> >> "Al Grant" <acgrant@orcon.net.nz> wrote:
> >>
> >> >Hmmm - I cant find dataobject as a type of variable, and I get a
compile
> >> >error - user-defined type not defined???
> >> >
> >> >-Al
> >> >
> >> >
> >> >"Peter Hewett" <nospam@xtra.co.nz> wrote in message
> >> >news:65lvi0lcdvcuj4lrmiu6nolqb58tv8tsb8@4ax.com...
> >> >> Hi Helmut Weber
> >> >>
> >> >> No I didn't - you'd already posted the code in the previous thread!
> >And
> >> >Al's definitely
> >> >> smart enough to do the integration.
> >> >>
> >> >> Cheers - Peter
> >> >>
> >> >>
> >> >> Helmut Weber <elmkqznfwvccbf@mailinator.com>, said:
> >> >>
> >> >> >Hi Al,
> >> >> >this is the part, which Peter took for granted:
> >> >> >---
> >> >> >Dim oDat As DataObject
> >> >> >Dim sAll As String
> >> >> >Set oDat = New DataObject
> >> >> >oDat.GetFromClipboard
> >> >> >On Error GoTo TheEnd
> >> >> >sAll = oDat.GetText
> >> >> >MsgBox sAll
> >> >> >Exit Sub
> >> >> >TheEnd:
> >> >> >MsgBox "No text in Clipboard"
> >> >> >---
> >> >> >Greetings from Bavaria, Germany
> >> >> >Helmut Weber
> >> >> >"red.sys" & chr(64) & "t-online.de"
> >> >> >Word XP, Win 98
> >> >>
> >> >> HTH + Cheers - Peter
> >> >>
> >> >
> >> >
> >> >
> >> >
> >> >-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> >> >http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> >> >-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
> >>
> >
> >
> >
> >
> >-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> >http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> >-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
>




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----

Re: Parsing string on clipboard by Peter

Peter
Sun Aug 29 23:30:37 CDT 2004

Hi Al Grant

You need to write you own function. I don't currently have a Word 97 version of Office
installed - so I don't know whether you can write a function like this:

Public Function Spliter(ByVal ToSplit As String, _
ByVal Delimiter As String) As String()
Const ARRAY_INCREMENT As Long = 10

Dim lngPosition As Long
Dim lngLastPosition As Long
Dim lngUsed As Long
Dim astrChunks() As String

' Basic validation
If LenB(ToSplit) = 0 Then Exit Function
If LenB(Delimiter) = 0 Then Exit Function

' Allocate initial array
ReDim astrChunks(0 To ARRAY_INCREMENT - 1)

' Find the first delimiter
lngPosition = InStr(1, ToSplit, Delimiter)
lngLastPosition = 1

' Chop up the input string using the delimiter and put each chunk into the array
Do While lngPosition > 0

' Make sure there is enough space in the array for the next element
MakeSpace astrChunks, lngUsed, ARRAY_INCREMENT

' Add string to array
astrChunks(lngUsed) = Mid$(ToSplit, lngLastPosition, _
lngPosition - lngLastPosition)

' Reset string index for next interation
lngLastPosition = lngPosition + 1

' Find next delimiter (if any)
lngPosition = InStr(lngLastPosition, ToSplit, Delimiter)

' Increment counter for next iteration
lngUsed = lngUsed + 1
Loop

' Add last (or only chunk to the array)
MakeSpace astrChunks, lngUsed, ARRAY_INCREMENT
astrChunks(lngUsed) = Mid$(ToSplit, lngLastPosition)

' Trim array to correct size and return it to the user
ReDim Preserve astrChunks(0 To lngUsed)
Spliter = astrChunks
End Function

Private Function MakeSpace(ByRef astrArray() As String, _
ByVal lngUsed As Long, _
ByVal lngIncremnt As Long)

' Make sure there is enough space in the array for the next element
If lngUsed > UBound(astrArray) Then

' Increase array size
ReDim Preserve astrArray(0 To UBound(astrArray) + lngIncremnt - 1)
End If
End Function


You can in Office 2000, because it supports functions that return arrays. Try the above
and if it's no go well hack it into a Sub that returns an array (as the MakeSpace Sub
does).

HTH + Cheers - Peter


"Al Grant" <acgrant@orcon.net.nz>, said:

>After getting it working on my pc at home I found out we are on office 97 at
>work!!!
>
>No split command :-(
>
>-Al
>
>"Peter Hewett" <nospam@xtra.co.nz> wrote in message
>news:er13j0p9srss8t7a0v41772j1ngu4h50p9@4ax.com...
>> Hi Al Grant
>>
>> An earlier post in this thread uses Split so why not use that:
>>
>> Dim astrLines() as String
>>
>> astrLines() = Split(sAll, Chr$(13))
>>
>> then replace str1 with astrLines(0) , str2 with astrLines(1), etc.
>>
>> HTH + Cheers - Peter
>>
>>
>> "Al Grant" <acgrant@orcon.net.nz>, said:
>>
>> >Hmmm, I am getting closer with:
>> >
>> >Public Sub ParseClipboarData()
>> > Dim str1 As String
>> > Dim str2 As String
>> > Dim str3 As String
>> > Dim strId As String
>> > Dim strRNS As String
>> > Dim strName As String
>> > Dim strAddress As String
>> > Dim strWork() As String
>> >
>> >xstart = 1
>> >str1 = Mid(sAll, xstart, InStr(xstart, sAll, Chr(13)))
>> >MsgBox testval1
>> >xstart = InStr(xstart, sAll, Chr(13)) + 2
>> >str2 = Mid(sAll, xstart, InStr(xstart, sAll, Chr(13)) - xstart)
>> >MsgBox testval2
>> >
>> >but I still think their is a better way to increment xstart, rather than
>> >line by line?
>> >
>> >Cheers
>> >
>> >-Al
>> >
>> >"Jay Freedman" <jay.freedman@verizon.net> wrote in message
>> >news:hj12j09umv32hr4v6970gf4dq3eefsakhp@4ax.com...
>> >> Hi Al,
>> >>
>> >> In the VBA editor, go to the Tools > References dialog and check the
>> >> box next to Microsoft Forms 2.0 Object Library. That will make the
>> >> DataObject available. You'll have to repeat this in each template
>> >> project where you want to use a DataObject.
>> >>
>> >> --
>> >> Regards,
>> >> Jay Freedman http://aspnet2.com/mvp.ashx?JayFreedman
>> >> Microsoft Word MVP FAQ: http://word.mvps.org
>> >>
>> >> "Al Grant" <acgrant@orcon.net.nz> wrote:
>> >>
>> >> >Hmmm - I cant find dataobject as a type of variable, and I get a
>compile
>> >> >error - user-defined type not defined???
>> >> >
>> >> >-Al
>> >> >
>> >> >
>> >> >"Peter Hewett" <nospam@xtra.co.nz> wrote in message
>> >> >news:65lvi0lcdvcuj4lrmiu6nolqb58tv8tsb8@4ax.com...
>> >> >> Hi Helmut Weber
>> >> >>
>> >> >> No I didn't - you'd already posted the code in the previous thread!
>> >And
>> >> >Al's definitely
>> >> >> smart enough to do the integration.
>> >> >>
>> >> >> Cheers - Peter
>> >> >>
>> >> >>
>> >> >> Helmut Weber <elmkqznfwvccbf@mailinator.com>, said:
>> >> >>
>> >> >> >Hi Al,
>> >> >> >this is the part, which Peter took for granted:
>> >> >> >---
>> >> >> >Dim oDat As DataObject
>> >> >> >Dim sAll As String
>> >> >> >Set oDat = New DataObject
>> >> >> >oDat.GetFromClipboard
>> >> >> >On Error GoTo TheEnd
>> >> >> >sAll = oDat.GetText
>> >> >> >MsgBox sAll
>> >> >> >Exit Sub
>> >> >> >TheEnd:
>> >> >> >MsgBox "No text in Clipboard"
>> >> >> >---
>> >> >> >Greetings from Bavaria, Germany
>> >> >> >Helmut Weber
>> >> >> >"red.sys" & chr(64) & "t-online.de"
>> >> >> >Word XP, Win 98
>> >> >>
>> >> >> HTH + Cheers - Peter
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
>> >> >http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
>> >> >-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
>> >>
>> >
>> >
>> >
>> >
>> >-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
>> >http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
>> >-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
>>
>
>
>
>
>-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
>http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
>-----== Over 100,000 Newsgroups - 19 Different Servers! =-----