General discussion

Locked

VB 6.0 as front end.

By madhavichin ·
If I have more than 2 MS-Word files containing the text and diagrams or any other data. How can I club those data and put them in a single MS-Word file. Please help me in this concept and mail me the solution for this with a sample example.

Waiting for ur reply...
Thanking you,

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

VB 6.0 as front end.

by tjc In reply to VB 6.0 as front end.

Are you talking about writting a VB program to do this automatically for you?

Else it may just be easire to just load up each file and then do a copy & paste from each document.

Collapse -

VB 6.0 as front end.

by madhavichin In reply to VB 6.0 as front end.

give me a clearcut solution. I want to do this by vb program automatically.

thank u

Collapse -

VB 6.0 as front end.

by LexingtonIT In reply to VB 6.0 as front end.

create one form with two textboxes and one command button. paste the following codes.
Select the MS word object references for the project.

in text1 enter the directories that contains all the word documents.
in text2 enter the name of the final single file you want to save.

then click on command1. It should work.

HTH

Willie


Private Sub Command1_Click()

Dim fso
Dim f
Dim file

Dim x As New Word.Document

Set fso = CreateObject("Scripting.FileSystemObject")

Set f = fso.Getfolder(Text1.Text & "\")

For Each file In f.Files
If Right(file.Name, 3) = "doc" Then
x.Range(0, 1).InsertFile Text1.Text & "\" & file.Name, , False
End If
Next

x.SaveAs Text2.Text

MsgBox "Done and saved as " & Text2.Text


End Sub

Back to IT Employment Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums