
Adding one document to another
Hi Jerry,
Well, you really do have a lot of options. Having all the files in single
directory is great (have a look at the article " Insert into a document the
names of all files in a selected folder" at
http://www.mvps.org/word/FAQs/MacrosVBA/InsertFileNames.htm)
Having them select the order is a quite bit more difficult, and I suggest
that you avoid that option if you can.
Quote:
> I have only just started it so I am not sure which would be the best way
to
> go. All the files will be in a single directory. I am hoping to use a
dialog
> box that will say something like concatenate all files in folder and then
> allow you to browse to that folder. Or better yet is there a way to do
that
> that will allow you to select the files in the order you want them
inserted?
> The mice are spinning now.
> > Hi Jerry,
> > The simple answer is yes. However, it depends on how you have set up the
> > routine for it to access the next file. Are you using the FileSearch
> object,
> > or are you reading all the files from a single directory into an array?
In
> > short, how does the routine know the name/location of "next file"?
> > > Is there a way to have it get the next file instead of telling it a
file
> > > name?
> > > > Farsad,
> > > > This is exactly what I am doing with a current project. I
> > > > am creating a composite document that consists of many
> > > > individual documents using a VB6 interface. Here is what
> > > > I got from an earlier post, modified for my particular use:
> > > > 1. Set pWordDoc = objWord.ActiveDocument
> > > > 2. pWordDoc.Parent.Selection.EndKey 6
> > > > 3. pWordDoc.Parent.Selection.InsertFile sDocName
> > > > Line 1 - set a point to the active document
> > > > Line 2 - move to the 'end' of the document
> > > > Line 3 - insert another document at this location. Note
> > > > that the value for sDocName must be a valid filename.
> > > > HTH
> > > > >-----Original Message-----
> > > > >Hi
> > > > >I was wondering how I could add one document to the end
> > > > of
> > > > >another in word using vb6?
> > > > >I have one document that is one page and another document
> > > > >that is also one page. I would like the second document
> > > > to
> > > > >paste itself into a second page on the first document.
> > > > >I would really appreciate your help
> > > > >Thank you
> > > > >Farsad
> > > > >.