SelectAll then paste into new doc

T

td

After opening a doc I want to select all text (excluding file headers &
footers) and copy it into a new document. I can start Word, open the required
doc & close it but I cannot seem to get the syntax of the SelectAll. What I
have is something along the lines

Dim wrd as Word.Application

Set wrd = CreateObject("Word.Application")
wrd.document.open Filename:=strFileName,ReadOnly:=True
<Want to select all text>
<Want to copy to clipboard>
I can then close the active document, paste the clipboard into a new doc &
save the new doc.
Many thanks
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?dGQ=?=,
After opening a doc I want to select all text (excluding file headers &
footers) and copy it into a new document. I can start Word, open the required
doc & close it but I cannot seem to get the syntax of the SelectAll. What I
have is something along the lines

Dim wrd as Word.Application

Set wrd = CreateObject("Word.Application")
wrd.document.open Filename:=strFileName,ReadOnly:=True
<Want to select all text>
<Want to copy to clipboard>
ActiveDocument.Content.Select
Selection.Copy

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top