underscore line

M

MarcoPolo

another qucik question:

If i have "year ________ month _______ day _________ in ________"
and i need to delete all the underscore line with a text , how can i do it?

i dont know how long is the line cause it comes from different procedures
and lenght is not always same
 
M

MarcoPolo

I mean how can I select the underscore line as a "doucle click" with the
mouse?
 
C

Cindy M -WordMVP-

Hi MarcoPolo,
another qucik question:

If i have "year ________ month _______ day _________ in ________"
and i need to delete all the underscore line with a text , how can i do it?

i dont know how long is the line cause it comes from different procedures
and lenght is not always same
Your requirement isn't clear. Do you need to delete only the underlines, or
also some text? If yes, which text? Or do you mean you need to delete the
entire line (or even paragraph)?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
M

MarcoPolo

Grüßgott Cindy:)

I meant that i need to replace allthe underscore with variables
for example "year ____" gets "year 2005" and "month _______" gets "month
February"
or "year ______________" gets "year 2005" and "month
______________" gets "month February"
how can i replace the underscore with the locYear and aMonth(i)
as i dont know how long can be the underscore line?
 
D

Doug Robbins - Word MVP

Why don't you use formfields in place of the underlines.

--
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
 
M

MarcoPolo

I can't cause it comes from an external society and they make this funny
documents..
i'm using now Replace all for it but...not any toher idea?
 
H

Helmut Weber

Hi Marco,

like this:

Public Sub test0001234()
Dim rDcm As Range
Set rDcm = ActiveDocument.Range
With rDcm.Find
.MatchWildcards = True
.Text = "year _{1,}"
.Replacement.Text = "year 2005"
.Execute Replace:=wdReplaceAll
.Text = "month _{1,}"
.Replacement.Text = "month February"
.Execute Replace:=wdReplaceAll
.Text = "day _{1,}"
.Replacement.Text = "day Monday"
.Execute Replace:=wdReplaceAll
' ... more
End With
End Sub

Note: in "{1,}" for "one or more underline characters"
the comma is the listseperator in, lets call it,
international or english versions of word.
In German, Dutch, Norwegian etc. versions it is
a semicolon ";".

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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

Top