Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting Rows into Word Documents

Status
Not open for further replies.

bmatthews

IS-IT--Management
Oct 5, 2006
2
US
Greetings all,

First off, anyone that can help me is a saint and I love you more than anything in the world. :)

Here is what I am trying to do.

I have a master excel document that will contain dynamic information (i.e will be updated often) I am trying to program this spreadsheet to cycle through each row of data and export that row to its own word document.

for example:
******
row1 (export) word1
row2 (export) word2
loop this until it hits a empty row and then kill the program
******

Here is what I have so far, however I am having trouble 1) exporting to word and 2) automating it.

<code>
Rows("1:1").Select

ChDir "C:\Documents and Settings\Brandon\Desktop"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Brandon\Desktop\Project1\2\test\test1.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
</code>

I know this is simple, but I have tried other snippets of code before, however they failed. This oddly enough is the cleanest. :D

Yet again, I appreciate anyone who will take out their time to help me.

-Brandon

 
bmatthews,
Since you didn't provide any details on how you want export that (Excel) row to its own word document, here is a thread from a couple weeks ago that has a couple of samples of how to move data from Excel to Word. Look for the code samples posted 14 Sep 06 14:33, it deals with putting the data in a Word table, but I think it will get you moving in the right direction.

VBA Visual Basic for Applications (Microsoft) Forum:
Setting up and filling a Word document table from Excel

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
Thank you so much for your reply!

I will look into this and get back with any results.

-Brandon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top