find/replace

  • Thread starter Stephen Larivee
  • Start date
S

Stephen Larivee

Win XP, Word 2003

I exported a field in FileMaker Pro. It is a repeating field with two dates
in one field. I thought I could import the field into Word and find the
marker that separates one date from the next and do a Replace All and put a
Tab between the two dates and then put the dates into two different fields,
the way they belong. I have the field in Word and there is a small
rectangle between the dates. So far nothing I have used as a Find has
"found" it, except for White Space (^w), but when I do a find ^w and replace
^t, Word replaces thousands of the occurences but the demon white rectanges
remain. I even tried copying and pasting the rectange into the Find box but
that is not working.

I have a posting on a FileMaker Pro board to see if someone can show me how
to separate the dates from with FileMaker, but it seems I should be able to
do it from within Word.

Does anyone have a suggestion???
 
D

Doug Robbins - Word MVP

If you send the file to me at dkr[atsymbol]mvps[dot]org I will have a look
at it.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
C

CyberTaz

Have you tried copying the unknown character & pasting it into the Find
box... You'll need to use Control+V to do the paste. I don't know if that
will work, but it may be worth a shot.

The basic problem is that the 'separator' between the 2 dates is an uncommon
unidentified character. Unless the suggestion works or you can find some way
to identify it accurately there isn't much you can do in Word's F&R without
some crafty criteria... Perhaps Graham Mayor, macropod, or one of the other
gurus can come up with something.

I think your best bet is going to be in FM, though. It's been years since I
worked with it, but I seem to remember an option for outputting the content
of repeating fields as separate fields. You might also consider importing
the data into Excel to see if the dates get picked up correctly... And Excel
also has a 'Text to Columns' feature.

HTH |:>)
Bob Jones
[MVP] Office:Mac
 
D

Doug Robbins - Word MVP

The unknown character is a Group Separator (ASCII 29) and to deal with it
you must use

ActiveDocument.Range.Text = Replace(ActiveDocument.Range.Text, Chr(29),
Chr(9))

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
S

Stephen Larivee

Thank you for your help and the file you worked on. The finished file is
just what I was trying to do. I think my only question would be, How did
you know that the separating mark was ASCII 29?
 
G

Graham Mayor

The following macro will give you the value of a selected character

Sub ANSIValue()
S1$ = "Because the selected text contains"
S2$ = " characters, not all of the ANSI values will be displayed."
S3$ = "ANSI Value ("
S4$ = " characters in selection)"
S5$ = " character in selection)"
S6$ = "Text must be selected before this macro is run."
S7$ = "ANSI Value"
Dim strSel, strNums, LastFourChar As String
Dim iPos As Integer
strSel = Selection.Text
If Len(strSel) > 0 Then
For i = 1 To Len(strSel)
strNums = strNums + Str(Asc(Mid(strSel, i)))
Next i
strNums = LTrim(strNums)
If Len(strNums) > 255 Then
LastFourChar = Mid(strNums, 252, 4)
strNums = Left(strNums, 251) + Left(LastFourChar, 4 - InStr(" ",
LastFourChar))
MsgBox S1$ + Str(Len(strSel)) + S2$
End If
If Len(strSel) = 1 Then S4$ = S5$
MsgBox strNums, 0, S3$ + LTrim(Str(Len(strSel))) + S4$
Else
MsgBox S6$, 0, S7$
End If
End Sub

http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Stephen Larivee

Thank you!!

Graham Mayor said:
The following macro will give you the value of a selected character

Sub ANSIValue()
S1$ = "Because the selected text contains"
S2$ = " characters, not all of the ANSI values will be displayed."
S3$ = "ANSI Value ("
S4$ = " characters in selection)"
S5$ = " character in selection)"
S6$ = "Text must be selected before this macro is run."
S7$ = "ANSI Value"
Dim strSel, strNums, LastFourChar As String
Dim iPos As Integer
strSel = Selection.Text
If Len(strSel) > 0 Then
For i = 1 To Len(strSel)
strNums = strNums + Str(Asc(Mid(strSel, i)))
Next i
strNums = LTrim(strNums)
If Len(strNums) > 255 Then
LastFourChar = Mid(strNums, 252, 4)
strNums = Left(strNums, 251) + Left(LastFourChar, 4 - InStr(" ",
LastFourChar))
MsgBox S1$ + Str(Len(strSel)) + S2$
End If
If Len(strSel) = 1 Then S4$ = S5$
MsgBox strNums, 0, S3$ + LTrim(Str(Len(strSel))) + S4$
Else
MsgBox S6$, 0, S7$
End If
End Sub

http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top