Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default 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
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
Putting an Excel pivot report in a letter in Word! sumrgrl New Users to Excel 2 June 12th 09 04:20 PM
Importing Excel report into Word showing headers and footers LossManiac Excel Discussion (Misc queries) 1 August 29th 08 01:56 PM
Export excel data to create report in Word jbrzez Excel Discussion (Misc queries) 2 January 30th 07 02:21 PM
Turning Excel Worksheet Linked to Word Document into Report Templa Jordan Rose Excel Programming 0 September 19th 05 06:19 PM
How do you add an Excel spread sheet to a Microsoft Word report? RaymondTBirmingham Excel Worksheet Functions 1 March 14th 05 07:19 AM


All times are GMT +1. The time now is 03:35 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"