It seems to work when you first load up the document (most times!) but once
I've updated some fields (I use a Word doc as a source) and the computer has
recalculated, the IncludeText fields vanish and are replaced yet again by
"Error! Not a valid filename" with seemingly no way to get them to appear
again?
I don't understand why it initially works but suddenly is unable to find the
file. Am I just not using the correct code or is this a really annoying bug
in Word? Below is the code I'm using at the moment.
{INCLUDETEXT "letterhead.doc" letterhead}
If anyone has any idea how I can get Word to use an implicit filename in the
IncludeText field correctly, please let me know so I can stop annoying my
wife with my constant moaning and MS Word bashing!
Thanks.
Simon
What version of Word is involved?
What happens when you try a field syntax like this? And please show us what
Word does to the field code (if anything):
{INCLUDETEXT ".\\letterhead.doc" letterhead}
> It seems to work when you first load up the document (most times!) but once
> I've updated some fields (I use a Word doc as a source) and the computer has
> recalculated, the IncludeText fields vanish and are replaced yet again by
> "Error! Not a valid filename" with seemingly no way to get them to appear
> again?
>
> I don't understand why it initially works but suddenly is unable to find the
> file. Am I just not using the correct code or is this a really annoying bug
> in Word? Below is the code I'm using at the moment.
>
> {INCLUDETEXT "letterhead.doc" letterhead}
>
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
Thanks for the suggestion. I've tried using the code suggested and at
first, I thought that it had worked but unfortunately, the same thing
happens again. After a few changes to the data in the mergefields via the
edit mergefield dialog, the letterhead disappears and is replaced by "Error!
Bookmark not defined.". The letterhead does contain mergefields for the name
and address, could that be causing problems? I'm also getting "Error! Not a
valid filename." in the footer which contains a couple of logos that I load
in from another library file.
I'm afraid I'm not sure what you mean when you ask what Word does to the
field code? I've noticed in another section of my letter where I load in a
form using IncludeText that Word sometimes adds /*MERGEFORMAT to the end of
the expression but this seems to cause some of the inserted text to appear
in the wrong font and size so I delete it. Is that what you mean?
Hope this helps to clarify my problem, thanks.
Simon.
"Cindy Meister -WordMVP-" <CindyM...@swissonline.ch> wrote in message
news:VA.00005841.007eb8e7@speedy...
Hmmm. I wish I could watch over your shoulder...
> After a few changes to the data in the mergefields via the
> edit mergefield dialog, the letterhead disappears and is replaced by
"Error!
> Bookmark not defined."
>
Are you editing the mergefields (changing their names or something), or
the data that appears in them? Please try to be as accurate in your
terminology as possible; use the title bars from the dialog boxes, the
labels in the dialog boxes, and quote exact error messages. Otherwise, we
end up talking at cross-purposes and nothing gets solved. (And no, please
don't attach any screen shots or other files.)
In general, mail merge doesn't really like to work with headers and
footers. It's usually more reliable to use a StyleRef field to pick up the
content of a particular style...
> I'm afraid I'm not sure what you mean when you ask what Word does to the
> field code?
>
I'm particularly interested if it 1) Changes a path you've entered; 2)
Addes a \* MergeformatINET switch, or 3) sticks the characters 20% into
your path.
Not sure where your problem is coming from. As an alternative, you might
want to try inserting the letterhead using either VBA or AutoText. See the
letterhead system at <URL: http://addbalance.com/word/download.htm> for
ideas. While there is an IncludeText tutorial there, I don't think it
answers your questions.
--
Charles Kenyon
Word New User FAQ & Web Directory:
<URL: http://addbalance.com/word/index.htm>
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://addbalance.com/usersguide/index.htm>
See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
"Free 24-7 News" <si...@colluney.f9.co.uk> wrote in message
news:3ca22...@news.greennet.net...
The letters I have produced are used by staff throughout my room. They open
up the particular letter they need depending on what cirumstances they
client is in. I have set up each letter with a standard set of data already
in (example - "mr", "john" and "smith" in the ADDR_Title, ADDR_Forename and
ADDR_Surname fields). The user will then begin to edit the data by clicking
on the 'Edit Data Source' button in the toolbar (I've created my own toolbar
with just the buttons the user will need, the 'Edit Data Source' button is
one of them). This action brings up the dialog box entitled 'Data Form'
which has a long list of the mergefields. Each letter has it's own Word
document as a merge source document as each letter requires different
options and fields. Some fields are output straight out to the letter, some
have formatting options such as the "\*Caps" modifier and some are a code
(1, 2 or 3 for example) which will output a different paragraph depending on
the number entered in the relevant field.
This all seems to work fine apart from the \*Caps modifier having some odd
effects on the text at times. It seems to be on the names of people, it
occasionally leaves the first letter in small case. It is solved by
right-clicking on the field clicking on "update field". Repeating the
process however reverts the name back to all small case?
Onto the main problem of the INCLUDETEXT function...
The letterhead (and other graphics) are stored in a file simply called
"letterhead.doc" This letterhead has been set up with mergefields already
contained within it for name, address, Reference number etc. These are in
the form of IF..THEN..ELSE statements so that if the country for example
isn't required, there is no blank line between county and Postcode
{IF{Country}<>"" "{Country \*Caps}"""}
These don't work ofcourse until the letterhead is loaded into the main
document via the INCLUDETEXT function. Below is the main code I am using at
the moment to incorporate the letterhead into the main document,
{INCLUDETEXT ".\\Letterhead.doc" Letterhead}
Once loaded into the main document, the fields take on the text that is
already stored in the merge source document for that particular letter. To
bring in some graphics, I am again using the INCLUDETEXT function,
{INCLUDETEXT ".\\Letterhead.doc" Logo}
This is contained in a table within the footer (I like to use tables for
formatting) and like the letterhead, appears to work fine upon loading up
the letter.
After clicking on the 'Edit Data Source' button and changing a couple of
fields (usually I just add a couple of letters to either ADDR_Forname or
ADDR_Surname, just something to see if it updates the letter correctly) the
letterhead and graphics will tend to disappear and be replaced by
"Error! Cannot open file."
This will usually happen within three attempts of going into the 'Data Form'
dialog, changing some of the field entires and clicking 'OK'. Just to add
to my confusion, I today took the exact same letter I've been working on to
try on my Dad's computer (Word 2000) and I couldn't seem to get the
letterhead to disappear leading me to believe that my problem may be more a
setup problem that a syntax problem.
To answer your questions, Word has never changed the path name I've entered
or added '20%' anywhere (is that the code for a space?) but it has added
\*MERGEFORMAT to a couple of INCLUDETEXT fields I have added at the bottom
of the letter to bring in some forms if neccessary. I think it only did it
when I changed the actual code from Times to Arial font. I just leave it in
times now to avoid any problems.
Regarding the suggestion to try using VBA or Autotext, I'll certainly have a
look at the sites suggested if it will solve this strange problem. Thanks
again for your help, it is really appreciated.
Thanks,
Simon.
"Cindy Meister -WordMVP-" <CindyM...@swissonline.ch> wrote in message
news:VA.0000584e.003564b7@speedy...
Thanks for the detailed explanation
> This all seems to work fine apart from the \*Caps modifier having some odd
> effects on the text at times. It seems to be on the names of people, it
> occasionally leaves the first letter in small case. It is solved by
> right-clicking on the field clicking on "update field". Repeating the
> process however reverts the name back to all small case?
>
that's a strange one. Can't say I've ever heard of this, before. You might
try looking for a pattern (specific documents; specific records; specific
combinations of letters? Might there be a space before the name, in the data
source?)
RE the IncludeText
This is a long shot, but check in Tools/Options/General/Web Options/Files (I
think that's the right set of commands) for an entry about updating paths to
linked files. There's a bug in Word 2002 that prompted me to ask about the
20% and MergeInet switch associated with this option. The bug is not reported
in Word 2000, but that doesn't mean something couldn't be happening in the
background that no one has been aware of up until now. Try turning this
option off.
> {INCLUDETEXT ".\\Letterhead.doc" Logo}
> After clicking on the 'Edit Data Source' button and changing a couple of
> fields (usually I just add a couple of letters to either ADDR_Forname or
> ADDR_Surname, just something to see if it updates the letter correctly) the
> letterhead and graphics will tend to disappear and be replaced by
>
> "Error! Cannot open file."
>
As a general rule, Word really loves full path references. One can "trick" it
into using relative paths, but it really shouldn't surprise too much when odd
things happen. My "gut feeling" is that Word might be switching to a
different path internally (that of the data source?), rather than referring
to the path in which the main merge document is saved. As a test, you could
try copying (a slightly modified) Letterhead.doc into the same folder as the
data source...
Thanks for all the help and suggestions I've received regarding this
problem, it is very much appreciated. I'll be sure to post a message to the
group if the options setting sorts out my problem at work.
Thanks again.
Simon Colluney.
"Cindy Meister -WordMVP-" <CindyM...@swissonline.ch> wrote in message
news:VA.000058a6.004e8549@speedy...
> I'm happy to report that your long shot appears to be working through Word
> 2002. Until now, I could hardly get this version to recognise the
> letterhead let alone keep it on screen. I tried the same trick in Word 2000
> but it still seems to have the same problem.
>
Glad Word 2002 ended up fixing something (sorta) <g>
As to Word 2000: the only other suggestion would be to *lock* these fields so
that they can't continuously be updated. Manually, Ctrl+F11 locks;
Ctr+Shift+F11 unlocks. You could conceivably automate the process of
locking/unlocking targeted fields using a macro.