Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2006

Tip: Looking for answers? Try searching our database.

macro to manipulate selected text only

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Holwick - 27 Nov 2006 04:52 GMT
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
dholwick@gmail.com
Jezebel - 27 Nov 2006 05:24 GMT
Why not set the left and right indents, rather than mangling the text?

>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.
[quoted text clipped - 44 lines]
> Rev. David Holwick
> dholwick@gmail.com
David Holwick - 27 Nov 2006 15:40 GMT
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)

> Why not set the left and right indents, rather than mangling the text?
Jezebel - 29 Nov 2006 08:11 GMT
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.

>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)
>
>> Why not set the left and right indents, rather than mangling the text?
Graham Mayor - 27 Nov 2006 05:35 GMT
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.

Signature

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> 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
[quoted text clipped - 39 lines]
> Rev. David Holwick
> dholwick@gmail.com
David Holwick - 27 Nov 2006 15:41 GMT
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)

> 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.
aalaan - 27 Nov 2006 17:28 GMT
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.

>I am trying to make a VBA macro that works line-by-line on one
(...etc)
David Holwick - 27 Nov 2006 19:40 GMT
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!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.