Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Word 2007 - field "Update automatic links at open" does not work | Excel Discussion (Misc queries) | |||
cancel the "Getting Started" Dialogue Box when I open XL/Word | Setting up and Configuration of Excel | |||
How to disable "New" "open" menu items in Excel 2007 | Excel Programming | |||
Why do I receive "Fill not found" message when I open Excel? | Setting up and Configuration of Excel | |||
"word unable to open data source" message when trying to do mail m | Excel Discussion (Misc queries) |