Piping data to other office applications

C

CellShocked

Hello,

Is there a way to have flat file format "table" data on one worksheet
automatically fill data into an MS Word document's "field" areas?

I can build this "report" in excel using simple vlookups and a
scrolling selector for the "unit number", but piping the same data over
to the currently accepted form(s) would be cool.

I know this is probably not the exact correct group for this, but doing
it via a macro would likely be the next logical step, so...
 
M

marcus

Hi

Rather than using vb to bring the data in where the formatting can be
no always reliable (particualarily the curning of the words). Why not
use a link between XL and Word. Copy your table in XL, now open your
word document in the place the cursor where you want your table.

Goto Edit - PasteSpecial -

On the form select - Microsoft Office Excel Worksheet Object

Click the Paste Link radio button.

Now when ever your XL sheet changes so will your Word document change
to reflect the changes in XL.

Take care

Marcus
 
C

CellShocked

You failed to see the requisite. Must use existing word document.

I already know how to paste an excel table into word. All I want to do
is paste excel data into an *existing* word document.

I will simply have to construct the entire Word document in Excel if
there is no way to pass the data over.

At that point, (recreating the entire document) the word document would
no longer be needed.

Getting them to incorporate it at work is a different story, however.
 
R

ryguy7272

Take a look at this:
http://word.mvps.org/FAQs/InterDev/ControlWordFromXL.htm

This too:
http://addbalance.com/usersguide/fields.htm

And this:
http://gregmaxey.mvps.org/Word_Fields.htm

Finally, once you get the DocVariable fields set up in Word (hit Alt + F9 to
see all fields), run this code from Excel.
Sub PushToWord()

Dim objWord As New Word.Application
Dim doc As Word.Document
Dim bkmk As Word.Bookmark
sWdFileName = Application.GetOpenFilename(, , , , False)
Set doc = objWord.Documents.Open(sWdFileName)

With doc
..Variables("VarNumber1").Value = Range("VarNumber1").Value
..Variables("VarNumber2").Value = Range("VarNumber2").Value
'etc
..Range.Fields.Update
End With

'ActiveDocument.Fields.Update

objWord.Visible = True

End Sub

Note: This code runs in Excel; pushes Excel variables (assigned as Named
Ranges) to Word.

Regards,
Ryan--
 
C

CellShocked

Thank you. That looks like it pretty much covers the entire gamut of
anything I could possibly need. :)

Thanks again.
 

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