I posted before, but i fear i may not have explained my thoughts.
What i have is a form with multiple user inputs. Currently i use the DCom to accomplish the merging of documents
THe have documents that are numbered. There is a main ( stylized) document that is opened and then i want to insert ( add) these other documents ( or at least thier contents) to my main ( stylized) document and then save it under a new name. I am a VB developer, most code on this site is in C and i dont understand it… Here is a reference of my code:
Dim WordApp As New Word.Application
'set the file name from the open file dialog
Dim fileName As Object = "http:/jamoss01/intranet9/trusts/data/blank.doc"
Dim readOnly2 As Object = True
Dim isVisible As Object = True
' Here is the way to handle parameters you don't care about in .NET
Dim missing As Object = System.Reflection.Missing.Value
' Make word visible, so you can see what's happening
WordApp.Visible = False
' Open the document that was chosen by the dialog
Dim aDoc As Word.Document = WordApp.Documents.Open(fileName, missing, [readOnly2], missing, missing, missing, missing, missing, missing, missing, missing, isVisible) ' Activate the document so it shows up in front aDoc.Activate();
Dim range As Word.Range = aDoc.Range(Start:=0, End:=0)
'The doc path should be relative to the web
Dim docpath As String = "http://jamoss01/intranet9/trusts/data/"
' Now we do if statements from last to first
If Section160.Checked = True Then
range.InsertFile(docpath & "section160.doc")
End If
If Section159.Checked = True Then
range.InsertFile(docpath & "section159.doc")
.......and so on until
aDoc.SaveAs("C:\inetpub\wwwroot\intranet9\trusts\output\" & outputname.Text & ".doc")
aDoc.Application.Quit(missing, missing, missing)
I want to do the same thing without DCOM