OK, maybe I misunderstood your question because I do not speak Italian and I
have to guess
But
a. I think you want to do this:
LINK "nomefile" [range] [parametri]
Where each client has a different Excel file called "nomefile", and the name
of the file is stored in a field (campo) called NOMEDIUNFILE, in the Access
database that you are using as your data source. And either you want a page
called DEDICATO from that file, or you want to get the name of the page from
a field called DEDICATO.
b. In theory you should be able to do the following. Use Alt-F9 to reveal
the field codes (so you see the special {}, then work directly with the
field. Use ctrl-F9 to insert new {} and use one of the following.
If DEDICATO is the name of your Excel Sheet, use:
{ LINK Excel.Sheet.8 "{ MERGEFIELD NOMEDIUNFILE }" "DEDICATO!R1:R65536"
[parametri} }
Or, if DEDICATO is an Access field that contains the name of your Excel
sheet, use
{ LINK Excel.Sheet.8 "{ MERGEFIELD NOMEDIUNFILE }" "{ MERGEFIELD
DEDICATO}!R1:R65536" [parametri} }
But, there are some problems:
a. when you merge, you may get the same worksheet for every client. You can
merge to an output document, select all (ctrl-A), then press F9.
b. you get too many rows. Unfortunately I do not know how to specify "all
the data in the sheet" using a LINK field. You cannot just use "DEDICATO!" -
it does not work. In fact, I do not think it can be done.
c. in some versions of Word you may find that the nested fields are removed
when you upfdate the LINK field, which will make this approach useless.
However, instead, you can use an INCLUDETEXT field which looks like this:
{ INCLUDETEXT "{ MERGEFIELD NOMEDIUNFILE }" "DEDICATO!" [parametri} }
or
{ INCLUDETEXT "{ MERGEFIELD NOMEDIUNFILE }" "{ MERGEFIELD DEDICATO}!"
[parametri} }
This should update correctly, and should bring in the whole sheet. But
(1) you will have to look at Word Help for the right [parametri]
(2) the data from the spreadsheet may not be displayed exactly how you
want. For example, numbers and dates may appear differently. There is not
much you can do to change this if you use INCLUDETEXT.
(3) the Access field NOMEDIUNFILE must contain the full path name of the
Excel workbook. It may need to be like this:
c:\excel\wb.xls
or like this
c:\\excel\\wb.xls
If the field only contains the name of the workbook (wb.xls) you will need
something more like
{ INCLUDETEXT "c:\\excel\\{ MERGEFIELD NOMEDIUNFILE }" DEDICATO!
[parametri} }
What do you mean "try using DATABASE field" ?
Forget this, for the moment.
Can you explain better?
Excuse for my bad English
It is better than my Italian
If you do not understand something, please expalin in Italian and as well as
you can in English. I will do my best!
--
Peter Jamieson - Word MVP
Word MVP web site
http://word.mvps.org/
maxtri said:
Hi,
Thank you for the answer.
I would like to do this:
Word document.doc with:
Pag1
aaa asdfdsf dfhfdgh dfgh dfghdfhg dfhg dfgh sdfasdf asdf gadf sadffff
sdg sdf g sdf gsd fg sdf g sdf g sdfg asdf asdf asdf ffff sddddddddd dd
sdfg sdfg sd <<Data1cli1From record1ACCESS>> dsftgsd fg sdfgd
sdjf has djkfh kjh akjsdhf kjash dkjfh aksjh f sdf sdf ffrtyhret ety ueytt
kjhsdfkj <<data2fromRec1access>> asdjfh akjdhfjahs fg adfg adfg
--------------------------------------------------------
| 12213!dh j kjhs dk! skdjhfkjsh ! lkj kjlkjlkjlkj lkj lk j |
|-------------------------------------------------------|
| 12213!dh j kjhs dk! skdjhfkjsh ! lkj kjlkjlkjlkj lkj lk j | <---
Variable File Excel associated to CLIENT 1
|-------------------------------------------------------| <-- I would
like to get the variable-excel FILENAME from a
| 12213!dh j kjhs dk! skdjhfkjsh ! lkj kjlkjlkjlkj lkj lk j | <-- FIELD
in the Access associated corrent RECORD.
|-------------------------------------------------------|
sdjf has djkfh kjh akjsdhf kjash dkjfh aksjh f sdf sdf ffrtyhret ety ueytt
kjhsdfkj <<data3fromRec1access>> asdjfh akjdhfjahs fg adfg adfg
ecc. ecc. pag2, pag3.
Iesterday I tryed your suggests but don't works.
What do you mean "try using DATABASE field" ?
I must INSERT directly te Excel file in a ole FIELD of the same table that
I'm using in access or what?
Can you explain better?
Excuse for my bad English
Massimo Trivelli
Peter Jamieson said:
I cannot be sure that I understood your question, but...
If you are trying to do
Client1
<<table of data from an Excel spreadsheet for Client1>>
Client2
<<table of data from an Excel spreadsheet for Client2>>
Instead of using a LINK field to get your Excel data, try using a DATABASE
field. (Use Tools|Customize to enable the Database toolbar, then use
Insert|Database. You will probably need to use ODBC to connect to your
databases). I have not tested this, but it is what I would try.
(con
i
relativi parametri es.: LINK "nomefile" [range] [parametri]) ecc. ) sapete
se è possibile passargli in qualche modo tale informazione parametrizzandola
grazie al campo unione sopra citato? (quello che contiene il nome del file
EXCEL ovviamente)
Con una MACRO in VB non ci sono problemi....
Ho fatto qualche prova e penso di poterci riuscire.
Per evitare tutto questo.... magari c'è un sistema più semplice...
Una volta che creo il link non riesco più a gestirlo, di fatto ne servirebbe
uno diverso ad ogni avanzamento del record nella QUERY.
Con lo stesso FILE funziona... ma che ci faccio se il file è, ovviamente,
personalizzato per cliente ed ha un mome diverso ad ogni riga?
Grazie di ogni eventuale suggerimento