Moving text from Doc to Doc 
Author Message
 Moving text from Doc to Doc

I would like to move only the text of a paragraph
(purposely not including the paragraph mark) from one
document to another. I would like to retain all character
formatting and all contents (including pics, charts, etc.)
but not the paragraph mark.  

I currently have a macro that creates a range of just the
text minus the paragraph mark, copies it, switches windows
and then pastes it.  I'm wondering if there is a way to
move the paragraph contents without having to switch
windows.  

The macro would have to keep track of the documents,
create a new paragraph in the target document for each
paragraph content that it copies from the original
document.  

Anyone have any ideas?  thanks.



Sat, 15 Jan 2005 11:05:59 GMT  
 Moving text from Doc to Doc
Hi Jason,

Define a variable to represent each document and also a range to represent
the data being copied

Dim Source as Document, Target as Document, myrange as range

Then set the variables to the respective documents

Set Source =
Set Target =

Then set the range to be copied

Set myrange=Source.Paragraphs(n).Range
myrange.end=myrange.end -1
Target.Range.InsertAfter myrange

Please post any response to the newsgroups for the benefit of others who may
also be following the thread.

Hope this helps,
Doug Robbins - Word MVP

Quote:
> I would like to move only the text of a paragraph
> (purposely not including the paragraph mark) from one
> document to another. I would like to retain all character
> formatting and all contents (including pics, charts, etc.)
> but not the paragraph mark.

> I currently have a macro that creates a range of just the
> text minus the paragraph mark, copies it, switches windows
> and then pastes it.  I'm wondering if there is a way to
> move the paragraph contents without having to switch
> windows.

> The macro would have to keep track of the documents,
> create a new paragraph in the target document for each
> paragraph content that it copies from the original
> document.

> Anyone have any ideas?  thanks.



Sat, 15 Jan 2005 17:57:36 GMT  
 Moving text from Doc to Doc
Thanks, Doug!

Quote:
>-----Original Message-----
>Hi Jason,

>Define a variable to represent each document and also a
range to represent
>the data being copied

>Dim Source as Document, Target as Document, myrange as
range

>Then set the variables to the respective documents

>Set Source =
>Set Target =

>Then set the range to be copied

>Set myrange=Source.Paragraphs(n).Range
>myrange.end=myrange.end -1
>Target.Range.InsertAfter myrange

>Please post any response to the newsgroups for the

benefit of others who may

- Show quoted text -

Quote:
>also be following the thread.

>Hope this helps,
>Doug Robbins - Word MVP


>> I would like to move only the text of a paragraph
>> (purposely not including the paragraph mark) from one
>> document to another. I would like to retain all
character
>> formatting and all contents (including pics, charts,
etc.)
>> but not the paragraph mark.

>> I currently have a macro that creates a range of just
the
>> text minus the paragraph mark, copies it, switches
windows
>> and then pastes it.  I'm wondering if there is a way to
>> move the paragraph contents without having to switch
>> windows.

>> The macro would have to keep track of the documents,
>> create a new paragraph in the target document for each
>> paragraph content that it copies from the original
>> document.

>> Anyone have any ideas?  thanks.

>.



Sun, 16 Jan 2005 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Saving a doc with name from doc text

2. Move caret to bottom right of visible text in doc window

3. Open word 97 doc with doc name as variable

4. Auto Download of doc files into new doc file from a web site

5. Auto close open doc when opening another doc

6. pub doc and word doc on same screen

7. Open a doc, grab a range without having the whole doc being tabled

8. How do you drop doc files from a intranet site into a new word doc

9. Inserting a doc into another doc

10. Opening a Word97 doc as a copy with no doc title

11. create a standard .doc from .doc form

12. Printing to doc then printing doc

 

 
Powered by phpBB® Forum Software