Re: Search and switch textorder in Word
- From: "Graham Mayor" <gmayor@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 16 Apr 2009 11:57:16 +0300
Unfortunately your original message made no mention of Chinese! Had it does
so I would not have attempted to offer a solution. I based my reply on the
string that you quoted. I regret I don't know anything about Chinese nor the
problems you are likely to encounter, but 12 hours to parse 6000 paragraphs
seems somewhat excessive. I guess that the macro is locked into a loop.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Jornebof wrote:
Hi Graham!
Thank you so much for your fast answer!
I tried the replace function that you mentioned but it didn't work.
The text in the (*) section just didn't move. I use Word 2003 is this
a known issue? If i use ([a-z]{1,}) it worked beautifully, but the
problem is that the text I want to move is in chinese. So I tried the
macro you sent me. It worked in a small file. But the file I want to
change text in is a 33MB txt-file and the text is to be replaced
around 6000 times. It has been running for 12 hours now and is still
not finished. Is this normal?
Best regards,
Fredrik
"Graham Mayor" wrote:
Does the line of text containing the fixed text end in a paragraph
mark? In which case the replace function will work Replace
(Fixedtext):(*)(^13)
with
\2\1\3
or with a macro you could use (say)
Dim oPara As Range
Dim sText() As String
For i = 1 To ActiveDocument.Paragraphs.Count
Set oPara = ActiveDocument.Paragraphs(i).Range
oPara.End = oPara.End - 1
If InStr(1, oPara.Text, "Fixedtext:") Then
sText = Split(oPara, ":")
oPara.Text = sText(1) & sText(0)
End If
Next i
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Jornebof wrote:
Hi!
I need to replace the textorder of some lines in a large document,
like this:
Fixedtext:xxx
where Fixedtext is fixed and xxx is any number of any characters
should be switched to look like this
xxxFixedtext
Is there anyone who can help me?
Thank you in advance!!
Fredrik Jornebo
.
- Follow-Ups:
- Re: Search and switch textorder in Word
- From: Klaus Linke
- Re: Search and switch textorder in Word
- References:
- Search and switch textorder in Word
- From: Jornebof
- Re: Search and switch textorder in Word
- From: Graham Mayor
- Re: Search and switch textorder in Word
- From: Jornebof
- Search and switch textorder in Word
- Prev by Date: Re: AutoTextEntries("Page X of Y") does not work in Word 2007
- Next by Date: Re: Modify content of a Field Code
- Previous by thread: Re: Search and switch textorder in Word
- Next by thread: Re: Search and switch textorder in Word
- Index(es):
Relevant Pages
|