A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Formatting Long Documents
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

copy part of document to new document



 
 
Thread Tools Display Modes
  #1  
Old June 28th, 2004, 09:03 AM
Ben
external usenet poster
 
Posts: n/a
Default copy part of document to new document

Hi,

I would like to know how to automate part of the
documentto be inserted into new document.
pleas advise.

thsnks,
regards,
Ben
  #2  
Old June 28th, 2004, 09:34 AM
Stefan Blom
external usenet poster
 
Posts: n/a
Default copy part of document to new document

See the following article:

http://www.gmayor.com/copying_selected_text.htm

If you want to use the macro solution and need further help with
installing the macro, also see:

http://www.gmayor.com/installing_macro.htm

--
Stefan Blom


"Ben" wrote in message
...
Hi,

I would like to know how to automate part of the
documentto be inserted into new document.
pleas advise.

thsnks,
regards,
Ben





  #3  
Old June 28th, 2004, 11:07 AM
Ben
external usenet poster
 
Posts: n/a
Default copy part of document to new document

Hi,

Is there a way that there is a method that will save the
file and the filename.

many tks.

regards,
Ben
-----Original Message-----
See the following article:

http://www.gmayor.com/copying_selected_text.htm

If you want to use the macro solution and need further

help with
installing the macro, also see:

http://www.gmayor.com/installing_macro.htm

--
Stefan Blom


"Ben" wrote in

message
...
Hi,

I would like to know how to automate part of the
documentto be inserted into new document.
pleas advise.

thsnks,
regards,
Ben





.

  #4  
Old June 28th, 2004, 11:42 AM
Stefan Blom
external usenet poster
 
Posts: n/a
Default copy part of document to new document

Simply add ActiveDocument.Save before the End Sub statement of any of
the macros suggested by Graham Mayor, and you will be prompted to save
the newly created document. For example:

Sub CopySelectedToNewDoc()
Selection.Copy
Documents.Add Template:="Normal", NewTemplate:=False, _
DocumentType:=0
Selection.Paste
ActiveDocument.Save 'Added
End Sub

Does this help?

--
Stefan Blom


"Ben" wrote in message
...
Hi,

Is there a way that there is a method that will save the
file and the filename.

many tks.

regards,
Ben
-----Original Message-----
See the following article:

http://www.gmayor.com/copying_selected_text.htm

If you want to use the macro solution and need further

help with
installing the macro, also see:

http://www.gmayor.com/installing_macro.htm

--
Stefan Blom


"Ben" wrote in

message
...
Hi,

I would like to know how to automate part of the
documentto be inserted into new document.
pleas advise.

thsnks,
regards,
Ben





.










  #5  
Old June 29th, 2004, 03:09 AM
ben
external usenet poster
 
Posts: n/a
Default copy part of document to new document

Hi,
it works perfectly in office 2000. can it be done in
office 97 as i have encountered error while running in
the office 97. by the way, for the macro part, do we need
to everytime code the vb script for the new file?

regards,
ben
-----Original Message-----
Simply add ActiveDocument.Save before the End Sub

statement of any of
the macros suggested by Graham Mayor, and you will be

prompted to save
the newly created document. For example:

Sub CopySelectedToNewDoc()
Selection.Copy
Documents.Add Template:="Normal", NewTemplate:=False, _
DocumentType:=0
Selection.Paste
ActiveDocument.Save 'Added
End Sub

Does this help?

--
Stefan Blom


"Ben" wrote in

message
...
Hi,

Is there a way that there is a method that will save

the
file and the filename.

many tks.

regards,
Ben
-----Original Message-----
See the following article:

http://www.gmayor.com/copying_selected_text.htm

If you want to use the macro solution and need further

help with
installing the macro, also see:

http://www.gmayor.com/installing_macro.htm

--
Stefan Blom


"Ben" wrote in

message
...
Hi,

I would like to know how to automate part of the
documentto be inserted into new document.
pleas advise.

thsnks,
regards,
Ben




.










.

  #6  
Old June 29th, 2004, 10:44 AM
Stefan Blom
external usenet poster
 
Posts: n/a
Default copy part of document to new document

Unfortunately, I haven't been able to test the macro in Word 97.

However, note that the macro assumes the following: (1) that there is
actually something selected when you run it and (2) that the newly
created document has the focus; either of these assumptions could
cause trouble. Below I have tried to take care of these situations by
altering the macro slightly. I have added a test to see if something
is selected before trying to copy and paste. I have also introduced a
variable to reference the newly created document as a Document object:

Sub CopySelectedToNewDoc()
Dim newdoc As Document
Dim s as Selection
Set s = Selection
If s.Type = wdNoSelection Or s.Type = wdSelectionIP Then
MsgBox "Nothing selected. Please try again."
Exit Sub
End If
s.Copy
Set newdoc = Documents.Add()
newdoc.Activate
s.Paste
ActiveDocument.Save
End Sub

Does this make a difference?

--
Stefan Blom


"ben" wrote in message
...
Hi,
it works perfectly in office 2000. can it be done in
office 97 as i have encountered error while running in
the office 97. by the way, for the macro part, do we need
to everytime code the vb script for the new file?

regards,
ben
-----Original Message-----
Simply add ActiveDocument.Save before the End Sub

statement of any of
the macros suggested by Graham Mayor, and you will be

prompted to save
the newly created document. For example:

Sub CopySelectedToNewDoc()
Selection.Copy
Documents.Add Template:="Normal", NewTemplate:=False, _
DocumentType:=0
Selection.Paste
ActiveDocument.Save 'Added
End Sub

Does this help?

--
Stefan Blom


"Ben" wrote in

message
...
Hi,

Is there a way that there is a method that will save

the
file and the filename.

many tks.

regards,
Ben
-----Original Message-----
See the following article:

http://www.gmayor.com/copying_selected_text.htm

If you want to use the macro solution and need further
help with
installing the macro, also see:

http://www.gmayor.com/installing_macro.htm

--
Stefan Blom


"Ben" wrote in
message
...
Hi,

I would like to know how to automate part of the
documentto be inserted into new document.
pleas advise.

thsnks,
regards,
Ben




.










.














  #7  
Old June 30th, 2004, 11:40 AM
ben
external usenet poster
 
Posts: n/a
Default copy part of document to new document

Hi,

It did not help much.
is it possible to determine the number of records in the
original document and copy into separate new documents
(based on number of record) once shot?
Tks

regards,
Ben
-----Original Message-----
Unfortunately, I haven't been able to test the macro in

Word 97.

However, note that the macro assumes the following: (1)

that there is
actually something selected when you run it and (2) that

the newly
created document has the focus; either of these

assumptions could
cause trouble. Below I have tried to take care of these

situations by
altering the macro slightly. I have added a test to see

if something
is selected before trying to copy and paste. I have also

introduced a
variable to reference the newly created document as a

Document object:

Sub CopySelectedToNewDoc()
Dim newdoc As Document
Dim s as Selection
Set s = Selection
If s.Type = wdNoSelection Or s.Type = wdSelectionIP Then
MsgBox "Nothing selected. Please try again."
Exit Sub
End If
s.Copy
Set newdoc = Documents.Add()
newdoc.Activate
s.Paste
ActiveDocument.Save
End Sub

Does this make a difference?

--
Stefan Blom


"ben" wrote in

message
...
Hi,
it works perfectly in office 2000. can it be done in
office 97 as i have encountered error while running in
the office 97. by the way, for the macro part, do we

need
to everytime code the vb script for the new file?

regards,
ben
-----Original Message-----
Simply add ActiveDocument.Save before the End Sub

statement of any of
the macros suggested by Graham Mayor, and you will be

prompted to save
the newly created document. For example:

Sub CopySelectedToNewDoc()
Selection.Copy
Documents.Add Template:="Normal", NewTemplate:=False,

_
DocumentType:=0
Selection.Paste
ActiveDocument.Save 'Added
End Sub

Does this help?

--
Stefan Blom


"Ben" wrote in

message
...
Hi,

Is there a way that there is a method that will save

the
file and the filename.

many tks.

regards,
Ben
-----Original Message-----
See the following article:

http://www.gmayor.com/copying_selected_text.htm

If you want to use the macro solution and need

further
help with
installing the macro, also see:

http://www.gmayor.com/installing_macro.htm

--
Stefan Blom


"Ben" wrote

in
message
...
Hi,

I would like to know how to automate part of the
documentto be inserted into new document.
pleas advise.

thsnks,
regards,
Ben




.










.














.

  #8  
Old July 1st, 2004, 08:17 AM
Stefan Blom
external usenet poster
 
Posts: n/a
Default copy part of document to new document

Are you talking about a mail merge? If this is the case, you'd
probably get better help if you posted the question in the
microsoft.public.word.mailmerge.fields group instead.

--
Stefan Blom


"ben" wrote in message
...
Hi,

It did not help much.
is it possible to determine the number of records in the
original document and copy into separate new documents
(based on number of record) once shot?
Tks

regards,
Ben
-----Original Message-----
Unfortunately, I haven't been able to test the macro in

Word 97.

However, note that the macro assumes the following: (1)

that there is
actually something selected when you run it and (2) that

the newly
created document has the focus; either of these

assumptions could
cause trouble. Below I have tried to take care of these

situations by
altering the macro slightly. I have added a test to see

if something
is selected before trying to copy and paste. I have also

introduced a
variable to reference the newly created document as a

Document object:

Sub CopySelectedToNewDoc()
Dim newdoc As Document
Dim s as Selection
Set s = Selection
If s.Type = wdNoSelection Or s.Type = wdSelectionIP Then
MsgBox "Nothing selected. Please try again."
Exit Sub
End If
s.Copy
Set newdoc = Documents.Add()
newdoc.Activate
s.Paste
ActiveDocument.Save
End Sub

Does this make a difference?

--
Stefan Blom


"ben" wrote in

message
...
Hi,
it works perfectly in office 2000. can it be done in
office 97 as i have encountered error while running in
the office 97. by the way, for the macro part, do we

need
to everytime code the vb script for the new file?

regards,
ben
-----Original Message-----
Simply add ActiveDocument.Save before the End Sub
statement of any of
the macros suggested by Graham Mayor, and you will be
prompted to save
the newly created document. For example:

Sub CopySelectedToNewDoc()
Selection.Copy
Documents.Add Template:="Normal", NewTemplate:=False,

_
DocumentType:=0
Selection.Paste
ActiveDocument.Save 'Added
End Sub

Does this help?

--
Stefan Blom


"Ben" wrote in
message
...
Hi,

Is there a way that there is a method that will save
the
file and the filename.

many tks.

regards,
Ben
-----Original Message-----
See the following article:

http://www.gmayor.com/copying_selected_text.htm

If you want to use the macro solution and need

further
help with
installing the macro, also see:

http://www.gmayor.com/installing_macro.htm

--
Stefan Blom


"Ben" wrote

in
message
...
Hi,

I would like to know how to automate part of the
documentto be inserted into new document.
pleas advise.

thsnks,
regards,
Ben




.










.














.






  #9  
Old July 2nd, 2004, 03:39 AM
Ben
external usenet poster
 
Posts: n/a
Default copy part of document to new document

Hi,
It is not a mail merge. It is just that a document in
which some part may require to put into new document. can
it be automate?

regards,
Ben
-----Original Message-----
Are you talking about a mail merge? If this is the case,

you'd
probably get better help if you posted the question in

the
microsoft.public.word.mailmerge.fields group instead.

--
Stefan Blom


"ben" wrote in

message
...
Hi,

It did not help much.
is it possible to determine the number of records in

the
original document and copy into separate new documents
(based on number of record) once shot?
Tks

regards,
Ben
-----Original Message-----
Unfortunately, I haven't been able to test the macro

in
Word 97.

However, note that the macro assumes the following:

(1)
that there is
actually something selected when you run it and (2)

that
the newly
created document has the focus; either of these

assumptions could
cause trouble. Below I have tried to take care of

these
situations by
altering the macro slightly. I have added a test to

see
if something
is selected before trying to copy and paste. I have

also
introduced a
variable to reference the newly created document as a

Document object:

Sub CopySelectedToNewDoc()
Dim newdoc As Document
Dim s as Selection
Set s = Selection
If s.Type = wdNoSelection Or s.Type = wdSelectionIP

Then
MsgBox "Nothing selected. Please try again."
Exit Sub
End If
s.Copy
Set newdoc = Documents.Add()
newdoc.Activate
s.Paste
ActiveDocument.Save
End Sub

Does this make a difference?

--
Stefan Blom


"ben" wrote in

message
...
Hi,
it works perfectly in office 2000. can it be done in
office 97 as i have encountered error while running

in
the office 97. by the way, for the macro part, do we

need
to everytime code the vb script for the new file?

regards,
ben
-----Original Message-----
Simply add ActiveDocument.Save before the End Sub
statement of any of
the macros suggested by Graham Mayor, and you will

be
prompted to save
the newly created document. For example:

Sub CopySelectedToNewDoc()
Selection.Copy
Documents.Add Template:="Normal",

NewTemplate:=False,
_
DocumentType:=0
Selection.Paste
ActiveDocument.Save 'Added
End Sub

Does this help?

--
Stefan Blom


"Ben" wrote

in
message
...
Hi,

Is there a way that there is a method that will

save
the
file and the filename.

many tks.

regards,
Ben
-----Original Message-----
See the following article:

http://www.gmayor.com/copying_selected_text.htm

If you want to use the macro solution and need

further
help with
installing the macro, also see:

http://www.gmayor.com/installing_macro.htm

--
Stefan Blom


"Ben"

wrote
in
message
...
Hi,

I would like to know how to automate part of

the
documentto be inserted into new document.
pleas advise.

thsnks,
regards,
Ben




.










.














.






.

  #10  
Old July 5th, 2004, 09:15 AM
Stefan Blom
external usenet poster
 
Posts: n/a
Default copy part of document to new document

Well, I suggested some macros to copy and paste the current selection
into a new document and prompt you to save them. I might be able to
help further, if you can specify exactly what the problem is with
those macros.

--
Stefan Blom


"Ben" wrote in message
...
Hi,
It is not a mail merge. It is just that a document in
which some part may require to put into new document. can
it be automate?

regards,
Ben
-----Original Message-----
Are you talking about a mail merge? If this is the case,

you'd
probably get better help if you posted the question in

the
microsoft.public.word.mailmerge.fields group instead.

--
Stefan Blom


"ben" wrote in

message
...
Hi,

It did not help much.
is it possible to determine the number of records in

the
original document and copy into separate new documents
(based on number of record) once shot?
Tks

regards,
Ben
-----Original Message-----
Unfortunately, I haven't been able to test the macro

in
Word 97.

However, note that the macro assumes the following:

(1)
that there is
actually something selected when you run it and (2)

that
the newly
created document has the focus; either of these
assumptions could
cause trouble. Below I have tried to take care of

these
situations by
altering the macro slightly. I have added a test to

see
if something
is selected before trying to copy and paste. I have

also
introduced a
variable to reference the newly created document as a
Document object:

Sub CopySelectedToNewDoc()
Dim newdoc As Document
Dim s as Selection
Set s = Selection
If s.Type = wdNoSelection Or s.Type = wdSelectionIP

Then
MsgBox "Nothing selected. Please try again."
Exit Sub
End If
s.Copy
Set newdoc = Documents.Add()
newdoc.Activate
s.Paste
ActiveDocument.Save
End Sub

Does this make a difference?

--
Stefan Blom


"ben" wrote in
message
...
Hi,
it works perfectly in office 2000. can it be done in
office 97 as i have encountered error while running

in
the office 97. by the way, for the macro part, do we
need
to everytime code the vb script for the new file?

regards,
ben
-----Original Message-----
Simply add ActiveDocument.Save before the End Sub
statement of any of
the macros suggested by Graham Mayor, and you will

be
prompted to save
the newly created document. For example:

Sub CopySelectedToNewDoc()
Selection.Copy
Documents.Add Template:="Normal",

NewTemplate:=False,
_
DocumentType:=0
Selection.Paste
ActiveDocument.Save 'Added
End Sub

Does this help?

--
Stefan Blom


"Ben" wrote

in
message
...
Hi,

Is there a way that there is a method that will

save
the
file and the filename.

many tks.

regards,
Ben
-----Original Message-----
See the following article:

http://www.gmayor.com/copying_selected_text.htm

If you want to use the macro solution and need
further
help with
installing the macro, also see:

http://www.gmayor.com/installing_macro.htm

--
Stefan Blom


"Ben"

wrote
in
message
...
Hi,

I would like to know how to automate part of

the
documentto be inserted into new document.
pleas advise.

thsnks,
regards,
Ben




.










.














.






.





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting problem with Word 2003 K Narayana Moorthy New Users 4 June 22nd, 2004 06:42 AM
Bookmarks are not retained during Mail Merge Latha Mailmerge 22 June 16th, 2004 08:53 PM
Master style document ? Bo Rasmussen New Users 5 June 14th, 2004 07:54 PM
If enveloped made part of document, envelope prints but the letter afterward does not print. NGibson General Discussion 1 May 23rd, 2004 07:42 AM
Help !!! Is word too small for my document??? lou New Users 2 April 30th, 2004 02:11 AM


All times are GMT +1. The time now is 06:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.