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 / Menus and Toolbars / January 2005

Tip: Looking for answers? Try searching our database.

macro to append text to another file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Huck Rorick - 26 Jan 2005 02:07 GMT
I am moving from WordPerfect.  I have a macro in word perfect that allows me
to highlight a piece of text and then append it to another file that is not
currently open.  This is a quick and handy way for me to put text into
different files without having to open each file, paste the text, then close
it and open another file, etc.

does anyone know if this can be done in Word, and if so, how?

thanks for any help,

Huck
Graham Mayor - 26 Jan 2005 04:56 GMT
You can copy selected text to a new document with the following macro

Sub CopySelectedToNewDoc()
   On Error GoTo oops
   Selection.Copy
   Documents.Add
   Selection.Paste
   End
oops:
MsgBox "Select the text you wish to copy first!"
End Sub

If you want to copy it to a particular document then you need to add the
extra code in place of Documents.Add

See http://www.gmayor.com/installing_macro.htm and
http://www.gmayor.com/copying_selected_text.htm

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

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

> I am moving from WordPerfect.  I have a macro in word perfect that
> allows me to highlight a piece of text and then append it to another
[quoted text clipped - 7 lines]
>
> Huck
Huck Rorick - 27 Jan 2005 04:12 GMT
Thank you very much.
I'm sorry to be so ignorant, but what code does one use to specify an
existing document?  (And where can I look that sort of thing up?  i.e. in
what part of Help?)

thanks

Huck

> You can copy selected text to a new document with the following macro
>
[quoted text clipped - 33 lines]
>>
>> Huck
Graham Mayor - 27 Jan 2005 05:31 GMT
Documents.Open FileName:="""D:\path\filename.doc"""

You could start with investigating the macro recorder and the vba help that
accompanies the vba editor. There is lots of help on vba in the mvps web
site (link in sig. block) and you can get help on the details from the
excellent vba newsgroups on this news server.

Signature

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

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

> Thank you very much.
> I'm sorry to be so ignorant, but what code does one use to specify an
[quoted text clipped - 42 lines]
>>>
>>> Huck
 
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.