Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel to Word report problem
I want to be able to open up a word document when a User Form opens in Excel. Once the word document is open, I want to add information to it, depending on criteria met whilst the user is using the form. So far I have been able to the Word report to open, but I'm not able to add further details to it when buttons are clicked in the user form. I'm sure this is straightforward, but I am struggling to see where I would be going wrong. Can anyone help? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel to Word report problem
Please post the code you have so far. "rharrison" wrote: I want to be able to open up a word document when a User Form opens in Excel. Once the word document is open, I want to add information to it, depending on criteria met whilst the user is using the form. So far I have been able to the Word report to open, but I'm not able to add further details to it when buttons are clicked in the user form. I'm sure this is straightforward, but I am struggling to see where I would be going wrong. Can anyone help? Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel to Word report problem
When the page loads, I have...
Set wordApp = CreateObject("Word.Application") With wordApp .Visible = True .Activate End With Set doc = wordApp.Documents.Add Then, when the individual clicks the button it has... With wordApp.Selection ..typetext "Test" etc. End With Obviously, it's not picking up the wordApp tag. But I'm not sure how to reference the application I've opened. Any help would be greatly appreciated. Many thanks. "Barb Reinhardt" wrote: Please post the code you have so far. "rharrison" wrote: I want to be able to open up a word document when a User Form opens in Excel. Once the word document is open, I want to add information to it, depending on criteria met whilst the user is using the form. So far I have been able to the Word report to open, but I'm not able to add further details to it when buttons are clicked in the user form. I'm sure this is straightforward, but I am struggling to see where I would be going wrong. Can anyone help? Thanks. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel to Word report problem
I'm not sure if this example is what you need, but I have a command button
on the form, btnWrite, which has the following code: Option Explicit Private Sub btnWrite_Click() Dim wordApp As Object Dim doc As Object With CreateObject("Word.Application") .Visible = True .Activate Set doc = .Documents.Add .Selection.typetext txtName.Text & vbCrLf .Selection.typetext txtAddress1.Text & vbCrLf .Selection.typetext txtAddress2.Text End With Unload Me End Sub this writes the contents of three text boxes to the document "rharrison" wrote in message ... When the page loads, I have... Set wordApp = CreateObject("Word.Application") With wordApp .Visible = True .Activate End With Set doc = wordApp.Documents.Add Then, when the individual clicks the button it has... With wordApp.Selection .typetext "Test" etc. End With Obviously, it's not picking up the wordApp tag. But I'm not sure how to reference the application I've opened. Any help would be greatly appreciated. Many thanks. "Barb Reinhardt" wrote: Please post the code you have so far. "rharrison" wrote: I want to be able to open up a word document when a User Form opens in Excel. Once the word document is open, I want to add information to it, depending on criteria met whilst the user is using the form. So far I have been able to the Word report to open, but I'm not able to add further details to it when buttons are clicked in the user form. I'm sure this is straightforward, but I am struggling to see where I would be going wrong. Can anyone help? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Putting an Excel pivot report in a letter in Word! | New Users to Excel | |||
Importing Excel report into Word showing headers and footers | Excel Discussion (Misc queries) | |||
Export excel data to create report in Word | Excel Discussion (Misc queries) | |||
Turning Excel Worksheet Linked to Word Document into Report Templa | Excel Programming | |||
How do you add an Excel spread sheet to a Microsoft Word report? | Excel Worksheet Functions |