Assess/Word merge "SaveAs"

  • Thread starter Thread starter 904allen
  • Start date Start date
9

904allen

I've integrated Albert D. Kallal's Mail Merge into my Access project, I been
able to get the merged doc saved to the directory it needs to be save in but
I can’t get it named. I have a field on all my merge forms in Assess called
[SetName] this field is also sent with the merge but is not merged to the
document. I only use the Function RidesMergeWord to merge my documents. Can
I specify in this function to save the merged document with the value in the
[SetName] field from the form or from the merged data (Merge.888) and if so
what is the proper language. I know where to put it I just don’t know what to
put there.
 
I can't get it named. I have a field on all my merge forms in Assess
called
[SetName] this field is also sent with the merge but is not merged to the
document. I only use the Function RidesMergeWord to merge my documents.
Can
I specify in this function to save the merged document with the value in
the
[SetName] field from the form or from the merged data (Merge.888) and if
so
what is the proper language. I know where to put it I just don't know what
to
put there.

Why are you using RidesMergeWord? You should only need to use

MergeSingleWord (merge the current form)

or use

MergeAllword (merge sql of your choice).

The syntax for both of these is outlined here:
http://www.members.shaw.ca/AlbertKallal/wordmerge/page2.html

So, you can use:

MergeSingleWord [dir],[bolFullPath],[strOutPutDoc]

Note how the above have provesions to set the output docuemnt name.

And, you can even merge withotu any prompts:

MergeNoPrompts
strFromDocTemplate,[strDir],[bolFullPath],[strOutPutDoc],[strSql],[bolPrint],[strPrinter]

So, to merge the current reocrd you are viewing, you can use:

dim strdocName as string

strDocName = "c:\MyOutPutDocs\" & me!FieldName & ".doc"

So, in code, you setup the docuemnt name which can be based in part, or full
for a field name.

MergeSingleWord ,,strDocName

So, it only one line of code, and you have to explain why you calling
RidesMergeWord direclty...you don't need to.....
 
Sorry to mislead you I do just use the WordMerge I setup the button according
to your instructions. MergeSingleWord
after read you response I then added

dim strdocName as string

strDocName = "C:\Case Management\CMDocs\" & me!SetName & ".doc"

but it just opens up 2 raw documents that are not named what am I doing wrong
 
Try something like:

MergeSingleWord ,,"C:\Case Management\CMDocs\" & me!SetName & ".doc"

The choice of STUFFimg the string into a variable is purely optional..

So, you *could* use the following:

dim strZooFunZoo as string
strZooFunZoo = "C:\Case Management\CMDocs\" & me!SetName & ".doc"

MergeSingleWord ,,strZooFunZoo

So, the choice of using a variable as per the 2nd example is simply
a choice of your coding style, and has no effect on how the code will work.

You are simply trying to provide a valid path + doc name for the 3rd
parameter of MergeSingleWord. You can use a variable to provide this,
or simply use an expression.

You don't need to declare a variable called strZoo, strJunk, or
whatever......
 
Back
Top