Exporting word count to Excel

lynnnow

Active Member
Joined
Aug 6, 2004
Messages
278
Hi,

Is there a way to export the word count of the active document to Excel. I've got the macro to get the word count and page count. however, i'm not sure what to use in order to get the data out of Word and into Excel.

I'm stumped with this part.

Any help will be appreciated.

:pray:
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
One way would be to save the number into a text file in Word, and pick it up in Excel. You could do this like this:

In Word

Code:
Open "c:\tempdata.txt" For Output As #1
   Write #1, wordcount, pagecount
Close #1

In Excel:

Code:
Open "c:\tempdata.txt" For Input As #1
   Input #1, wordcount, pagecount
Close #1

This method has some advantages as it doesn't rely on checking if the spreadsheet is already open, and can be used to pass data between any applications that can write text files.
 
Upvote 0

Forum statistics

Threads
1,224,830
Messages
6,181,229
Members
453,026
Latest member
cknader

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top