Re: Copying paragraphs including formatting.
From: Malik Al-Amin (malamin_at_ddd.com)
Date: 12/15/04
- Next message: Jean-Guy Marcil: "Re: Copying paragraphs including formatting."
- Previous message: Jezebel: "Re: Copying paragraphs including formatting."
- In reply to: Jezebel: "Re: Copying paragraphs including formatting."
- Next in thread: Jean-Guy Marcil: "Re: Copying paragraphs including formatting."
- Reply: Jean-Guy Marcil: "Re: Copying paragraphs including formatting."
- Reply: Jezebel: "Re: Copying paragraphs including formatting."
- Reply: macropod: "Re: Copying paragraphs including formatting."
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 15 Dec 2004 17:03:45 -0600
Thanks Jezebel
Is it more appropriate to use one over the other? Basically what I'm doing
is I have document1 open and I run a macro that opens up a document2. This
macro copies certain paragraphs from document one and certain paragraphs
from document two and merges them together in document3. I was using the
range object as I was under the impression that this was the object to use
if you're not highlighting anything in the document interface. is my logic
wrong? When merging things back together I want to keep the original
formatting of the paragraphs from their original sources. It was explained
how to do this via the selection object. Is that the way I should be heading
with this?
"Jezebel" <dwarves@heaven.com.kr> wrote in message
news:exOmugv4EHA.1404@TK2MSFTNGP11.phx.gbl...
> The Selection object is just a special case of Range object. For most
> coding
> purposes Selection and Ranges are interchangable.
>
>
>
>
> "Malik Al-Amin" <malamin@ddd.com> wrote in message
> news:%23KPJzSv4EHA.1400@TK2MSFTNGP11.phx.gbl...
>> Is there a way to achieve the same thing using the "range" object. I
>> chose
>> to use the range object instead of the selection object in my solution.
>> Since I'm using the range object i don't have anything "selected". How do
> I
>> get around this limitation?
>>
>> Thanks
>> "Jean-Guy Marcil" <no-spam@leaveme.alone> wrote in message
>> news:eYQoXhu4EHA.2568@TK2MSFTNGP11.phx.gbl...
>> > Malik Al-Amin was telling us:
>> > Malik Al-Amin nous racontait que :
>> >
>> >> Hi all,
>> >>
>> >> I know how to copy over the contents of a paragraph to a new document.
>> >> However my text is copied over but looses all of the formatting. How
>> >> can I copy and at the same time keep the formatting, including any
>> >> blank lines between sentences? Any ideas?
>> >>
>> >
>> > See the FormattedText property.
>> >
>> > Try this silly example on formatted text to see how it works:
>> >
>> > '_______________________________________
>> > Dim MyRange As Range
>> >
>> > Set MyRange = Selection.Range.FormattedText
>> >
>> > Selection.Collapse wdCollapseEnd
>> > Selection.TypeParagraph
>> > Selection.FormattedText = MyRange
>> > '_______________________________________
>> >
>> > --
>> > Salut!
>> > _______________________________________
>> > Jean-Guy Marcil - Word MVP
>> > jmarcilREMOVE@CAPSsympatico.caTHISTOO
>> > Word MVP site: http://www.word.mvps.org
>> >
>> >
>> >
>>
>>
>
>
- Next message: Jean-Guy Marcil: "Re: Copying paragraphs including formatting."
- Previous message: Jezebel: "Re: Copying paragraphs including formatting."
- In reply to: Jezebel: "Re: Copying paragraphs including formatting."
- Next in thread: Jean-Guy Marcil: "Re: Copying paragraphs including formatting."
- Reply: Jean-Guy Marcil: "Re: Copying paragraphs including formatting."
- Reply: Jezebel: "Re: Copying paragraphs including formatting."
- Reply: macropod: "Re: Copying paragraphs including formatting."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|