|
-
Jun 15th, 2000, 11:14 AM
#4
Thread Starter
Addicted Member
I have made a try-out of the code from you HDR, but the lines put in the word document are written in reverse !
Here is my example:
Private Sub Command1_Click()
Dim WordApp As Word.Application
Dim nCount As Integer: Dim x As Integer
'Starting Word
Set WordApp = New Word.Application
WordApp.Application.Visible = True
WordApp.Documents.Add
WordApp.ActiveDocument.Words(1).Font.Size = 10
WordApp.ActiveDocument.Words(1).InsertAfter "1-Name" & vbCrLf
WordApp.ActiveDocument.Words(1).InsertAfter "2-Adress" & vbCrLf
WordApp.ActiveDocument.Words(1).InsertAfter "3-City" & vbCrLf
For x = 1 To 5
WordApp.ActiveDocument.Words(1).InsertAfter " " & vbCrLf 'empty line
Next x
WordApp.ActiveDocument.Words(1).Font.Size = 8
For nCount = 0 To List1.ListCount - 1
WordApp.ActiveDocument.Words(1).InsertAfter List1.List(nCount) & vbCrLf
Next
WordApp.Application.Visible = True
Set WordApp = Nothing
End Sub
Private Sub Form_Load()
'fill the listbox
For x = 0 To 5
List1.AddItem "This is line " & x
Next x
End Sub
Can anyone try this out and tell me what to do to get it right ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|