A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Multiple Word Document Objects in 1 project? Is it possible?



 
 
Thread Tools Display Modes
  #1  
Old June 21st, 2004, 08:48 PM
Adam Steiner
external usenet poster
 
Posts: n/a
Default Multiple Word Document Objects in 1 project? Is it possible?

(Posted this earlier but it didn't seem to propogate, sorry if this is a
double).

Hi,

I have a word document which is about 20 pages long. It is 2 pages of form
fields which are then used to fill out the rest of the form. Unfortunately,
it takes a noticeable amount of time for the document to load and I will be
adding more documents (another 1-200 pages) in the near future.

What I was thinking of doing is having several documents, all part of the
same project (as different objects I guess). This way I could load the
documents as I need them and cut down on the load time (which I gather will
increase a lot more as I add these documents).

I haven't been able to find a way to add word documents to the project,
whenever I try it just adds another project that I can switch between. Can
anyone help, or does anyone have a different idea?

Thanks,

Adam



  #2  
Old June 22nd, 2004, 09:15 AM
Graham Mayor
external usenet poster
 
Posts: n/a
Default Multiple Word Document Objects in 1 project? Is it possible?

The technique described at http://www.gmayor.com/SelectFile.htm to insert
documents based on a form field selection may help.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Adam Steiner wrote:
(Posted this earlier but it didn't seem to propogate, sorry if this
is a double).

Hi,

I have a word document which is about 20 pages long. It is 2 pages
of form fields which are then used to fill out the rest of the form.
Unfortunately, it takes a noticeable amount of time for the document
to load and I will be adding more documents (another 1-200 pages) in
the near future.

What I was thinking of doing is having several documents, all part of
the same project (as different objects I guess). This way I could
load the documents as I need them and cut down on the load time
(which I gather will increase a lot more as I add these documents).

I haven't been able to find a way to add word documents to the
project, whenever I try it just adds another project that I can
switch between. Can anyone help, or does anyone have a different
idea?

Thanks,

Adam



  #3  
Old June 22nd, 2004, 03:29 PM
Adam Steiner
external usenet poster
 
Posts: n/a
Default Multiple Word Document Objects in 1 project? Is it possible?

"Graham Mayor" wrote in message
...
The technique described at http://www.gmayor.com/SelectFile.htm to insert
documents based on a form field selection may help.

--

Hi Graham,

That looks like it would work, although each file would be seperate. Out of
curiosity though, is it possible to have all of those files within a single
document, but as seperate document objects?


  #4  
Old June 22nd, 2004, 03:45 PM
Graham Mayor
external usenet poster
 
Posts: n/a
Default Multiple Word Document Objects in 1 project? Is it possible?

I am not sure what you are getting at here. You should aim to end up with a
single document, into which you can insert other documents (or parts of
other documents) using INCLUDETEXT fields as required.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Adam Steiner wrote:
"Graham Mayor" wrote in message
...
The technique described at http://www.gmayor.com/SelectFile.htm to
insert documents based on a form field selection may help.

--

Hi Graham,

That looks like it would work, although each file would be seperate.
Out of curiosity though, is it possible to have all of those files
within a single document, but as seperate document objects?



  #5  
Old June 22nd, 2004, 05:12 PM
Adam Steiner
external usenet poster
 
Posts: n/a
Default Multiple Word Document Objects in 1 project? Is it possible?

My bad. I was misreading some of the things on the link you sent me. This
will work. I was thinking that when you're in the VB IDE it says
'ThisDocument' by Word objects, I was wondering if, from there, you could
put ThisDocument2 etc in the same project.

--Adam

"Graham Mayor" wrote in message
...
I am not sure what you are getting at here. You should aim to end up with

a
single document, into which you can insert other documents (or parts of
other documents) using INCLUDETEXT fields as required.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Adam Steiner wrote:
"Graham Mayor" wrote in message
...
The technique described at http://www.gmayor.com/SelectFile.htm to
insert documents based on a form field selection may help.

--

Hi Graham,

That looks like it would work, although each file would be seperate.
Out of curiosity though, is it possible to have all of those files
within a single document, but as seperate document objects?





  #6  
Old June 23rd, 2004, 08:17 PM
Jay Freedman
external usenet poster
 
Posts: n/a
Default Multiple Word Document Objects in 1 project? Is it possible?

Hi, Adam,

I think you've just been confused by some ill-considered terminology (a.k.a.
"Softyisms"). Word is *not* like Visual Studio -- it has no concept of
workspaces or projects with documents nested within them, or anything like
that. One document is one document, period. The document may contain links
that make it display parts of other documents, but they remain separate
documents all the same.

The VBA IDE (which is actually a separate program from Word) shows that each
template and document has a code module named ThisDocument, but that is
*not* a document -- it's just a container for code. You can name your code
modules pretty much anything you like, but they won't be documents at all,
let alone separate documents within a project.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

Adam Steiner wrote:
My bad. I was misreading some of the things on the link you sent me.
This will work. I was thinking that when you're in the VB IDE it says
'ThisDocument' by Word objects, I was wondering if, from there, you
could put ThisDocument2 etc in the same project.

--Adam

"Graham Mayor" wrote in message
...
I am not sure what you are getting at here. You should aim to end up
with a single document, into which you can insert other documents
(or parts of other documents) using INCLUDETEXT fields as required.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Adam Steiner wrote:
"Graham Mayor" wrote in message
...
The technique described at http://www.gmayor.com/SelectFile.htm to
insert documents based on a form field selection may help.

--
Hi Graham,

That looks like it would work, although each file would be seperate.
Out of curiosity though, is it possible to have all of those files
within a single document, but as seperate document objects?



  #7  
Old June 29th, 2004, 04:54 PM
Adam Steiner
external usenet poster
 
Posts: n/a
Default Multiple Word Document Objects in 1 project? Is it possible?

(repost due to propogation issues)
"Jay Freedman" wrote in message
...
Hi, Adam,

I think you've just been confused by some ill-considered terminology

(a.k.a.
"Softyisms"). Word is *not* like Visual Studio -- it has no concept of
workspaces or projects with documents nested within them, or anything like
that. One document is one document, period. The document may contain links
that make it display parts of other documents, but they remain separate
documents all the same.

The VBA IDE (which is actually a separate program from Word) shows that

each
template and document has a code module named ThisDocument, but that is
*not* a document -- it's just a container for code. You can name your code
modules pretty much anything you like, but they won't be documents at all,
let alone separate documents within a project.


Jay,

Aha, now it makes sense. I had been under the impression that each module
(ThisDocument) represented an actual document in addition to the code.
Would you be able to point me in a direction of a website which discusses
how to use the Word document object outside of Word? Such as if I were to
use Visual Studio to write an app that contained multiple documents (which I
may do now).

Thanks
Adam


  #8  
Old June 30th, 2004, 02:39 AM
Jay Freedman
external usenet poster
 
Posts: n/a
Default Multiple Word Document Objects in 1 project? Is it possible?

"Adam Steiner" wrote:

Jay,

Aha, now it makes sense. I had been under the impression that each module
(ThisDocument) represented an actual document in addition to the code.
Would you be able to point me in a direction of a website which discusses
how to use the Word document object outside of Word? Such as if I were to
use Visual Studio to write an app that contained multiple documents (which I
may do now).

Thanks
Adam


I don't recall seeing anything that addresses the issue head-on, but
here are a couple of pages on the MVP site that show samples in the
course of discussing other topics:

http://www.word.mvps.org/faqs/interd...ateBinding.htm
http://www.word.mvps.org/faqs/interd...meInstance.htm
http://www.word.mvps.org/FAQs/InterD...WordFromXL.htm

Creating and using a Word object from standalone VB is very much the
same as doing it in VBA within another Office app such as Excel. And
once you have a Word object, you use the methods and properties of the
object model just as if you were in Word VBA.

Before you jump into this with both feet, though, figure out whether
what you want can be done entirely within Word. A single macro can
open and manipulate two, three, or more documents simultaneously, just
not in the way you were thinking before. For example, this dumb little
macro opens an existing file, creates two new blank documents, and
makes copies of the first paragraph of the first file in the other
two. When the macro finishes, you can use the Window menu to visit
each document and verify that it worked.

Sub MultiDocSample()
Dim SourceDoc As Document
Dim Target1 As Document, Target2 As Document
Dim SourceRg As Range, TargetRg As Range

' on error goto bye

' open existing doc
Set SourceDoc = Documents.Open("C:\temp\test.doc")
' make 2 new blank docs
Set Target1 = Documents.Add ' default Normal.dot
Set Target2 = Documents.Add ' default Normal.dot

' point to 1st paragraph of source
Set SourceRg = SourceDoc.Paragraphs(1).Range

' point to Target1 and copy source there
Set TargetRg = Target1.Range
TargetRg.FormattedText = SourceRg.FormattedText

' point to Target2 and copy source there
Set TargetRg = Target2.Range
TargetRg.FormattedText = SourceRg.FormattedText

bye:
' clean up
Set SourceDoc = Nothing
Set Target1 = Nothing
Set Target2 = Nothing
Set SourceRg = Nothing
Set TargetRg = Nothing
End Sub


--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://www.mvps.org/word
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:22 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.