Adding one document to another 
Author Message
 Adding one document to another

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



Sun, 27 Mar 2005 02:59:33 GMT  
 Adding one document to another
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

Quote:
>-----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
>.



Sun, 27 Mar 2005 03:24:13 GMT  
 Adding one document to another
Is there a way to have it get the next file instead of telling it a file
name?


Quote:
> 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
> >.



Sun, 27 Mar 2005 03:57:39 GMT  
 Adding one document to another
Jerry,

I think I pressed the worng button.  I thought I was
responding to your post, but posted an entirely new
thread :(

Please see the post labeled:

  "Automated file name processing..."

sorry for the confusion...

Regards, Lynn

Quote:
>-----Original Message-----
>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
>> >.

>.



Sun, 27 Mar 2005 04:39:19 GMT  
 Adding one document to another
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"?


Quote:
> 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
> > >.



Sun, 27 Mar 2005 05:02:20 GMT  
 Adding one document to another
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.


Quote:
> 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
> > > >.



Sun, 27 Mar 2005 21:30:17 GMT  
 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
> > > > >.



Sun, 27 Mar 2005 22:17:32 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. how to gather html from several documents and place into one big document

2. Adding records with one-to-one relationship

3. How to add a document to another document

4. Adding a document, then deleting that document

5. adding letter one by one in a label (animating it)

6. adding letter one by one in a label (animating it)

7. adding variable in document.add line

8. Multiple password changes in one step in office documents

9. Moving a selection from one document to the other

10. Accessing variables in one document from another

11. How to attach one or more external files to a mailmerge document

12. Posting data from one word document into another.

 

 
Powered by phpBB® Forum Software