Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Writing excel info into MS Word

Hi

I need to write out information from cells in Excel into MS Word.

a) Can this be done
b) Can it be done without having MS Word oopen
c) Do I need to have MS Word set up a particular way

If there are some examples somewhere that would be great.

Many Thanks

Steve
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Writing excel info into MS Word

Thanks

What if the Word document is a form and I need to place the cell info in a
particular place?




"Gary''s Student" wrote:

http://www.erlandsendata.no/english/...olecontrolword
--
Gary''s Student - gsnu200856


"Steve" wrote:

Hi

I need to write out information from cells in Excel into MS Word.

a) Can this be done
b) Can it be done without having MS Word oopen
c) Do I need to have MS Word set up a particular way

If there are some examples somewhere that would be great.

Many Thanks

Steve

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Writing excel info into MS Word

How to I add a reference to the word library

would this account for the error: User-defined type not defined

Thanks


"Steve" wrote:

Thanks

What if the Word document is a form and I need to place the cell info in a
particular place?




"Gary''s Student" wrote:

http://www.erlandsendata.no/english/...olecontrolword
--
Gary''s Student - gsnu200856


"Steve" wrote:

Hi

I need to write out information from cells in Excel into MS Word.

a) Can this be done
b) Can it be done without having MS Word oopen
c) Do I need to have MS Word set up a particular way

If there are some examples somewhere that would be great.

Many Thanks

Steve

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Writing excel info into MS Word

We are coming to the fun part!

Commanding Word means understanding Word's object model (which I don't). I
suggest you perform some experiments. Open the form manually and turn on the
macro recorder. Then practice pasting some information into the fields.
Then stop the recorder and examine the code that results.

Then adapt.
--
Gary''s Student - gsnu200856


"Steve" wrote:

Thanks

What if the Word document is a form and I need to place the cell info in a
particular place?




"Gary''s Student" wrote:

http://www.erlandsendata.no/english/...olecontrolword
--
Gary''s Student - gsnu200856


"Steve" wrote:

Hi

I need to write out information from cells in Excel into MS Word.

a) Can this be done
b) Can it be done without having MS Word oopen
c) Do I need to have MS Word set up a particular way

If there are some examples somewhere that would be great.

Many Thanks

Steve

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Writing excel info into MS Word

Cheers

I shall do that

I've sort the reference.

"Gary''s Student" wrote:

We are coming to the fun part!

Commanding Word means understanding Word's object model (which I don't). I
suggest you perform some experiments. Open the form manually and turn on the
macro recorder. Then practice pasting some information into the fields.
Then stop the recorder and examine the code that results.

Then adapt.
--
Gary''s Student - gsnu200856


"Steve" wrote:

Thanks

What if the Word document is a form and I need to place the cell info in a
particular place?




"Gary''s Student" wrote:

http://www.erlandsendata.no/english/...olecontrolword
--
Gary''s Student - gsnu200856


"Steve" wrote:

Hi

I need to write out information from cells in Excel into MS Word.

a) Can this be done
b) Can it be done without having MS Word oopen
c) Do I need to have MS Word set up a particular way

If there are some examples somewhere that would be great.

Many Thanks

Steve



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Writing excel info into MS Word

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''.


"Steve" wrote:

Cheers

I shall do that

I've sort the reference.

"Gary''s Student" wrote:

We are coming to the fun part!

Commanding Word means understanding Word's object model (which I don't). I
suggest you perform some experiments. Open the form manually and turn on the
macro recorder. Then practice pasting some information into the fields.
Then stop the recorder and examine the code that results.

Then adapt.
--
Gary''s Student - gsnu200856


"Steve" wrote:

Thanks

What if the Word document is a form and I need to place the cell info in a
particular place?




"Gary''s Student" wrote:

http://www.erlandsendata.no/english/...olecontrolword
--
Gary''s Student - gsnu200856


"Steve" wrote:

Hi

I need to write out information from cells in Excel into MS Word.

a) Can this be done
b) Can it be done without having MS Word oopen
c) Do I need to have MS Word set up a particular way

If there are some examples somewhere that would be great.

Many Thanks

Steve

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Writing excel info into MS Word

Appreciate this.

many Thanks

"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--


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


"Steve" wrote:

Cheers

I shall do that

I've sort the reference.

"Gary''s Student" wrote:

We are coming to the fun part!

Commanding Word means understanding Word's object model (which I don't). I
suggest you perform some experiments. Open the form manually and turn on the
macro recorder. Then practice pasting some information into the fields.
Then stop the recorder and examine the code that results.

Then adapt.
--
Gary''s Student - gsnu200856


"Steve" wrote:

Thanks

What if the Word document is a form and I need to place the cell info in a
particular place?




"Gary''s Student" wrote:

http://www.erlandsendata.no/english/...olecontrolword
--
Gary''s Student - gsnu200856


"Steve" wrote:

Hi

I need to write out information from cells in Excel into MS Word.

a) Can this be done
b) Can it be done without having MS Word oopen
c) Do I need to have MS Word set up a particular way

If there are some examples somewhere that would be great.

Many Thanks

Steve

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
Writing excel info into MS Word Gary''s Student Excel Programming 0 June 5th 09 07:50 PM
Excel Word copying info from Excel to Word without gridlines / bor Renee Thomas Excel Discussion (Misc queries) 2 September 13th 07 09:24 AM
Writing functions to prompt for info Conan Kelly Excel Worksheet Functions 1 December 28th 06 09:22 PM
Writing a Word doc from Excel Sheldon Excel Programming 3 October 22nd 04 06:06 PM
opening & writing to Word from Excel Mike Molyneaux[_2_] Excel Programming 2 October 21st 03 04:58 PM


All times are GMT +1. The time now is 05:44 PM.

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"