Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default excell auto-populate word?

I am attempting to make a Word Document which has some blanks
auto-populated from an Excel Workbook.

It would be best to create a Word Document to a sheet of an excel
workbook.
Am I on the right track?
How do I populate the blanks?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default excell auto-populate word?

Whoa! Looks like this is your first post ever, and you're posting in the
Excel Functions area, when you should really be posting this question in the
Excel Programming area. Oh well, I'll tell you how to do what you want to
do, but I feel it may take a little effort on your part to grasp everything.

How to send data from Excel to Word (using Fields):

In Word, click Insert Field DocVariable, then name your DocVariable.
Repeat as many times as necessary. In this example, I am using
BrokerFirstName and BrokerLastName. Basically, Im doing some analytics
in Excel, and preparing the results, in the form of a letter, to a
StockBroker, including the brokers first and last name and as many other
variables as necessary.


In Excel, hit Alt+F11, click Tools References check the reference for
Microsoft Word

xx.x Object Library. Then copy/paste this code into Excels Visual Basic
Editor window:

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)
'On Error Resume Next
objWord.ActiveDocument.variables("BrokerFirstName" ).Value =
Range("BrokerFirstName").Value
objWord.ActiveDocument.variables("BrokerLastName") .Value =
Range("BrokerLastName").Value
objWord.ActiveDocument.Fields.Update
'On Error Resume Next
objWord.Visible = True
End Sub

A few more examples for you...
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.

HTH,
Ryan--

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"LUCHA" wrote:

I am attempting to make a Word Document which has some blanks
auto-populated from an Excel Workbook.

It would be best to create a Word Document to a sheet of an excel
workbook.
Am I on the right track?
How do I populate the blanks?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default excell auto-populate word?

If you are using 07 then the process of linking is relatively simple.

Highlight the cells in Excel that you want to connect to Word and press
cntrl + C, to activate the copy function.

Go to the place in Word where you want this to appear and then click the
drop down menu below the Paste icon on the Home ribbon. Choose Paste Special.

You will now be presented with a Paste Special dialog box. Choose the Paste
Link option on the left hand side and then select the type of link that you
want to create. You will need to experiment with the formatting in both the
Excel document and the Word document as there are some issues here.

If this is helpful, please click Yes.

"LUCHA" wrote:

I am attempting to make a Word Document which has some blanks
auto-populated from an Excel Workbook.

It would be best to create a Word Document to a sheet of an excel
workbook.
Am I on the right track?
How do I populate the blanks?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto populate name BAKERSMAN Excel Discussion (Misc queries) 2 June 30th 09 07:28 AM
auto locking of excell workbook (excell 2003) cheekymonkey Excel Discussion (Misc queries) 2 November 14th 08 11:50 PM
Auto-populate, Auto-copy or Auto-fill? Jay S. Excel Worksheet Functions 4 August 10th 07 09:04 PM
Auto populate with value chris.howes Excel Discussion (Misc queries) 1 June 9th 06 06:33 PM
auto populate jdog Excel Discussion (Misc queries) 4 October 21st 05 11:51 PM


All times are GMT +1. The time now is 12:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"