Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Piping data to other office applications
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... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Piping data to other office applications
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Piping data to other office applications
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. On Thu, 10 Dec 2009 20:56:57 -0800 (PST), marcus wrote: 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Piping data to other office applications
Take a look at this:
http://word.mvps.org/FAQs/InterDev/C...WordFromXL.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-- -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "CellShocked" wrote: 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. On Thu, 10 Dec 2009 20:56:57 -0800 (PST), marcus wrote: 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 . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Piping data to other office applications
Thank you. That looks like it pretty much covers the entire gamut of
anything I could possibly need. :-) Thanks again. On Thu, 10 Dec 2009 23:12:02 -0800, ryguy7272 wrote: Take a look at this: http://word.mvps.org/FAQs/InterDev/C...WordFromXL.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-- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can you log users' interactions with MS Office applications? | Excel Programming | |||
Launch non-office applications through VBA | Excel Programming | |||
Office applications will not run | Setting up and Configuration of Excel | |||
Open Microsoft Office Applications from another computer? | Excel Discussion (Misc queries) | |||
Cannot create new? In all office 2003 applications | Excel Discussion (Misc queries) |