Albert Kallal's Word Mail Merge

  • Thread starter Thread starter Jim Murray
  • Start date Start date
J

Jim Murray

If I specify a location and name for the document's output does it overwrite
an existing document at that location if the name is the same? Am I doing
something wrong because it seems to overwrite without a warning.
 
I take the name of the output document from the template I use to create it
plus the PersonsID number from which I draw the data. I then add information
not included in the database. If I mistakenly create the document a second
time it seems to overwrite the first document and I lose the manually input
data.
Jim
 
Jim,

Then yes it does overwrite the document and not sure how to avoid that. In
order to prevent that I would think you would have to check if the document
is there already and then ask a if okay to overwrite. Is there a reason why
you choose to draw data not in the database?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
I'll try to write a short bit of code to check if there is already a document
with the same name.
I add data to the templates because the database does not contain the
personal bits of information that makes a letter something more than just
boilerplate. Also, I have many users of the database who do not agree with
the standard language of the criminal charges. Lawyers, hard to deal with and
you just can't kill them.
Thanks,
 
Jim,

Here's a few snippets I found that should get you started...

One...
If (Len(Dir(strPathAndFile)) > 0) Then


strFileName = "PathAndFileName"

If Len(Dir$(strFileName)) = 0 Then
' the file does not exist do something here

Else

'if file does exist do something here
End If


As for the lawyers... Well, you could but now that you have posted it a
newsgroup you probably won't get away with it! 8-)

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
Jim Murray said:
I take the name of the output document from the template I use to create it
plus the PersonsID number from which I draw the data. I then add
information
not included in the database. If I mistakenly create the document a second
time it seems to overwrite the first document and I lose the manually
input
data.
Jim

Yes, my code does overwrite the output document if you specify it.....

Since you gone to the trouble to come up with that document name in code,
then I do overwrite.

If you editing some data, and you change that data, then if you merge again,
then I overwrite that document to reflect this change.

I suppose I could prompt the user, but then the existing user base would be
somewhat annoyed....

In think in many cases (like your case), if the document already exists,
then I could perhaps prompt the user to allow either an edit, or overwrite
of that document. (often, if it exists already, then one wants to edit the
document...not create a new one).

i open to suggesting here as to what you think should happen.
 
Back
Top