macro to manipulate selected text only

D

David Holwick

I am trying to make a VBA macro that works line-by-line on one or more
paragraphs which I have selected with my mouse out of a larger document.
Specifically, I want to change the font size, put a newline character at the
end of each line, and add six spaces to the beginning of each line, but have
all this done only for the text my mouse has selected.

An example of the original text:

In a recent address to his the synod of his archdiocese, Archbishop Jensen
explained why issues of human sexuality are so important to the Christian
church. Consider this passage from his address:

As you know, I have taken the view from the beginning that the crisis
over human
sexuality is a very deep one indeed. The idea that we are somehow to
blame for
making so much fuss about sex is ludicrous. Human sexuality is so
powerful a
gift and so basic to our human nature, and so fraught with both good and
ill, that
it is bound to occupy a large part of our thinking.

How I want the final text to look:

In a recent address to his the synod of his archdiocese, Archbishop Jensen
explained why issues of human sexuality are so important to the Christian
church.
Consider this passage from his address:

As you know, I have taken the view from the beginning that
the crisis over human sexuality is a very deep one indeed.
The idea that we are somehow to blame for making so much
fuss about sex is ludicrous. Human sexuality is so powerful
a gift and so basic to our human nature, and so fraught
with both good and ill, that it is bound to occupy a large
part of our thinking.

Thank you for any help you can give me.

Sincerely
Rev. David Holwick
(e-mail address removed)
 
G

Graham Mayor

It would make more sense to create a paragraph style that has the layout you
want to achieve. Word formats with styles. The more you try to avoid them
the more complicated editing becomes.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
D

David Holwick

I need to clarify -- I want to reformat the text this way so I can paste it
in an Access memo field. Memo fields do not accept paragraph formatting, so
I cannot take that easy approach. (Holwick)
 
D

David Holwick

I need to clarify -- I want to reformat the text this way so I can paste it
in an Access memo field. Memo fields do not accept paragraph formatting, so
I cannot take that easy approach. (Holwick)
 
A

aalaan

Dear Rev.

If that's your genuine email address at the foot of your message, I'm afraid
you've made a boob! Publishing your real email address for all to see is
asking to be scanned and included on junk email lists. You will start to get
all manner of medical offers, banking scams, share buying 'tips' that are
scams, abusive emails from cranks and so on. In the end the only way out of
this is to change your email address because anyone you complain to will
just add to the list that your address is verified. Sent in a spirit of
goodwill.

David Holwick said:
I am trying to make a VBA macro that works line-by-line on one
(...etc)
 
D

David Holwick

Wise advice about email addresses. However, I've had mine online for a
number of years now and have learned to deal with the problem. Good filters
help!
 
J

Jezebel

Converting the Access field to RTF would be a better solution. Manually
formatted text, with leading spaces and hard returns for line breaks, isn't
worth anything to anybody.
 
J

Jezebel

On the Forms toolbar, select 'More Controls'. Select 'Microsoft Rich
Textbox' from the list. There are also many third party versions, with
various bells and whistles.
 
D

David Holwick

I wish I had known this six years ago! Many pluses in formatting and
appearance, but he shortcomings of all the tag info being visible in table
view, and strange formatting when viewing existing records through the Rich
Text control textbox on the form. I would still like to know how to do that
other macro, though...
 

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