Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default Excel to Open, Fill, and "package" .doc word forms


I'm not even sure how to word this question, but I've been given a challenge,
and I'm not sure how to go about it.

Firstly--I've created an Excel "application" that lets my underwriters fill
out information about their insured and the coverages we're insuring 1-2
times and it will auto populate throughout the rest of the different
documents (which are in separate tabs in the file) we include in an insurance
policy.

One of the documents is a form schedule--where the underwriters can choose
which forms, documentations and manuals they want to include in their package
to their insureds. This part was easy, they check off the form# they want,
hit a button, and I create a list of the forms they choose. Kind of like a
menu--they choose Form #1A, #4B, and #8C let's say. They hit OK, and I
generate a list
Forms you have selected:
#1A - Declarations Page
#4B - Schedule of Locations
#8C - Endorsement

Here's an additional feature they want. They now want the OK button to not
only generate that list, but also pull up the actual Declaration Page, or
Schedule, or Endorsement, which are .doc Microsoft word documents.

Here's my question. Is there a way for VBA in Excel to open up a Microsoft
Word Document, scan for form fields, fill it in with values from the excel
file, and package it in a PDF?

Any help or ideas would be greatly appreciated. Thanks much!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Excel to Open, Fill, and "package" .doc word forms

Sure, you can do that, but that's a tall order, so just take it one step at a
time. Start with 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''.


"Susan" wrote:

I'm not even sure how to word this question, but I've been given a challenge,
and I'm not sure how to go about it.

Firstly--I've created an Excel "application" that lets my underwriters fill
out information about their insured and the coverages we're insuring 1-2
times and it will auto populate throughout the rest of the different
documents (which are in separate tabs in the file) we include in an insurance
policy.

One of the documents is a form schedule--where the underwriters can choose
which forms, documentations and manuals they want to include in their package
to their insureds. This part was easy, they check off the form# they want,
hit a button, and I create a list of the forms they choose. Kind of like a
menu--they choose Form #1A, #4B, and #8C let's say. They hit OK, and I
generate a list
Forms you have selected:
#1A - Declarations Page
#4B - Schedule of Locations
#8C - Endorsement

Here's an additional feature they want. They now want the OK button to not
only generate that list, but also pull up the actual Declaration Page, or
Schedule, or Endorsement, which are .doc Microsoft word documents.

Here's my question. Is there a way for VBA in Excel to open up a Microsoft
Word Document, scan for form fields, fill it in with values from the excel
file, and package it in a PDF?

Any help or ideas would be greatly appreciated. Thanks much!

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
Word 2007 - field "Update automatic links at open" does not work bjoeran1 Excel Discussion (Misc queries) 1 May 26th 09 10:26 AM
cancel the "Getting Started" Dialogue Box when I open XL/Word jazzy1 Setting up and Configuration of Excel 1 May 2nd 08 12:53 AM
How to disable "New" "open" menu items in Excel 2007 Aruna Akella Excel Programming 1 March 26th 08 05:13 AM
Why do I receive "Fill not found" message when I open Excel? dmmahone Setting up and Configuration of Excel 0 March 28th 07 12:03 AM
"word unable to open data source" message when trying to do mail m funeralman Excel Discussion (Misc queries) 1 June 2nd 06 11:04 PM


All times are GMT +1. The time now is 07:22 PM.

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

About Us

"It's about Microsoft Excel"