Extracing info from one document while in another

B

bryan

If I am in a form document and entering data in formfields, is it possible to
extract info from a saved document to populate a few of the formfields?
I know the file path of the saved document.
Ideas....

Thanks,
Bryan
 
M

macropod

Hi Bryan,

Is there a reason the info has to go into a formfield? Why, for example, couldn't you use a standard INCLUDETEXT field (which you
could populate with a variable (eg a filename or a bookmark) from a formfield, if need be)?
 
B

bryan

When I open a protected document (an Issue WS) I am populating some of the
form fields from our host system.
What the users would like is to also extract some info from the Quote WS
rather than having to type it in again. This can only populate if the Quote
Ws is found.

So when I open the Issue WS, I already know where the Quite WS is stored so
I got the file path, I just need to know how to open the document and then
extract info from form fields

Thank,
Bryan



macropod said:
Hi Bryan,

Is there a reason the info has to go into a formfield? Why, for example, couldn't you use a standard INCLUDETEXT field (which you
could populate with a variable (eg a filename or a bookmark) from a formfield, if need be)?

--
Cheers
macropod
[MVP - Microsoft Word]


bryan said:
If I am in a form document and entering data in formfields, is it possible to
extract info from a saved document to populate a few of the formfields?
I know the file path of the saved document.
Ideas....

Thanks,
Bryan
 
D

Doug Robbins - Word MVP

Something like

Dim Source as Document, Target as Document
Set Target = ActiveDocument 'The document into which you want to insert the
data
Set Source = Documents.Open("Drive\Path\Filename") 'The document that
contains the data that you want to use
With Target
.FormFields("nameofformfieldintowhichyouwanttoinsertthedata").Result = _
Source.FormFields("nameofformfieldthatcontainsthedatathatyouwant").Result
'repeat as necessary for each item of required data
'Do other things with Target
.SaveAs
End With
Source.Close wdDoNotSaveChanges
Set Source = Nothing


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

bryan said:
When I open a protected document (an Issue WS) I am populating some of the
form fields from our host system.
What the users would like is to also extract some info from the Quote WS
rather than having to type it in again. This can only populate if the
Quote
Ws is found.

So when I open the Issue WS, I already know where the Quite WS is stored
so
I got the file path, I just need to know how to open the document and then
extract info from form fields

Thank,
Bryan



macropod said:
Hi Bryan,

Is there a reason the info has to go into a formfield? Why, for example,
couldn't you use a standard INCLUDETEXT field (which you
could populate with a variable (eg a filename or a bookmark) from a
formfield, if need be)?

--
Cheers
macropod
[MVP - Microsoft Word]


bryan said:
If I am in a form document and entering data in formfields, is it
possible to
extract info from a saved document to populate a few of the formfields?
I know the file path of the saved document.
Ideas....

Thanks,
Bryan
 
B

bryan

Thanks much.

Bryan

bryan said:
When I open a protected document (an Issue WS) I am populating some of the
form fields from our host system.
What the users would like is to also extract some info from the Quote WS
rather than having to type it in again. This can only populate if the Quote
Ws is found.

So when I open the Issue WS, I already know where the Quite WS is stored so
I got the file path, I just need to know how to open the document and then
extract info from form fields

Thank,
Bryan



macropod said:
Hi Bryan,

Is there a reason the info has to go into a formfield? Why, for example, couldn't you use a standard INCLUDETEXT field (which you
could populate with a variable (eg a filename or a bookmark) from a formfield, if need be)?

--
Cheers
macropod
[MVP - Microsoft Word]


bryan said:
If I am in a form document and entering data in formfields, is it possible to
extract info from a saved document to populate a few of the formfields?
I know the file path of the saved document.
Ideas....

Thanks,
Bryan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top