Albert K Word Merge

  • Thread starter Thread starter Curt
  • Start date Start date
C

Curt

Albert, I have been using your program without any
problems. I do have one question though. If possible how
do I designate where the documents will be placed other
than by code in the background. I am turning this program
over and if they place it on different shared drive then I
want it to find where they placed it at. Also, I am
looking at your search program that you created. If I
place a button on a few forms to have it open, will it
populate my form with the person or address that I am
searching?


Thanks for all your knowledge sharing
 
Curt said:
Albert, I have been using your program without any
problems. I do have one question though. If possible how
do I designate where the documents will be placed other
than by code in the background.

Yes..do note that you should be running a slit mdb if your system is
multi-user.

The instructions on how to change the location of the templates is here:

http://www.attcanada.net/~kallal.msn/wordmerge/page2.html
I am turning this program
over and if they place it on different shared drive then I
want it to find where they placed it at.

The directory used for the word merge are relative to the location of the
file being run. So, it is automatic. but, as mentioned, you REALLY REALLY
REALLY need to run a split database..and each user should be a mde on EACH
computer. (so, don't use a bad setup....this splitting of the database needs
to be done..and that has nothing to do with using, or not using my word
merge).
Also, I am
looking at your search program that you created. If I
place a button on a few forms to have it open, will it
populate my form with the person or address that I am
searching?

Yes...those little "glasses" buttions open the form to edit/dispaly he form.
The code to open that form is:


docmd.OpenForm "mainEdit",,,"id = " & me.id

So, you only need one line of code to open the form to the detail reocrd.
 
sdsa

Albert D. Kallal píše:
Yes..do note that you should be running a slit mdb if your system is
multi-user.

The instructions on how to change the location of the templates is here:

http://www.attcanada.net/~kallal.msn/wordmerge/page2.html


The directory used for the word merge are relative to the location of the
file being run. So, it is automatic. but, as mentioned, you REALLY REALLY
REALLY need to run a split database..and each user should be a mde on EACH
computer. (so, don't use a bad setup....this splitting of the database needs
to be done..and that has nothing to do with using, or not using my word
merge).


Yes...those little "glasses" buttions open the form to edit/dispaly he form.
The code to open that form is:


docmd.OpenForm "mainEdit",,,"id = " & me.id

So, you only need one line of code to open the form to the detail reocrd.


--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada
(e-mail address removed)
http://www.attcanada.net/~kallal.msn
 
Thanks for the response. I do have a split DB with a MDE
extension. I was just wondering about the Word folder. I
tried without incorporating code to tell it where to place
the templates and it kept the folder on my computer. SO I
created the code to tell it where to place the folder.
But since they may place the program on a different shared
drive I was trying to keep everything together without
them trying to figure out where the Word folder is so they
can all use the templates. Each desktop has a copy of the
FE rather than a shortcut to the FE is this wrong?

Thanks again
 
drive I was trying to keep everything together without
them trying to figure out where the Word folder is so they
can all use the templates. Each desktop has a copy of the
FE rather than a shortcut to the FE is this wrong?

The above is excleent.

The problem is that my desing kind of assuems that the templates will be on
each computer also. I suppose a soltion that works relative to the back end
mdb wojuld be kind of nice..but I have advoed adding this featutre since
templates don't like it very much when two users launch the same template.
My code does make VERY quick use of the template..and then closes it....so,
I suppose you could risk runing a few users..and lieky would not setop on
each other.

So, the soltion is to write a routine that returns the path name to the back
end..and hten assume a dir called word, or "templates". That should work.

stWordDir = "path to back end" & "WordTemplates"

You then can go:

MergeSingleWord stWordDir,True

So, you just need a rouinte to get the path to the back end.

So, in effect you could go:

stWordDir = strBackEndPath & "WordTemplates"

MergeSingleWord stWordDir,True

The follwing routine should do the trick:


Function strBackEndPath() As String

Dim mytables As TableDef

Dim strTempBack As String
Dim strFullPath As String
strFullPath = ""

For Each mytables In CurrentDb.TableDefs
If Left(mytables.Connect, 10) = ";DATABASE=" Then
strFullPath = Mid(mytables.Connect, 11)
Exit For
End If
Next mytables

strBackEndPath = Left(strFullPath, Len(strFullPath) -
Len(Dir(strFullPath)))

'strBackEndPath = strBackEndPath & "rides.mde"

'MsgBox (strBackEndPath)

end function
 
Thanks for the advice. I will give it a shot. Have you
ever thought about creating a Word folder to use these
templates? Then when Access uses one of the templates
have it create a temp folder on the user's machine. The
main forms would be on the server and a copy would be on
the user's machine. So the users would not step on each
other. Just a thought.. I like causing problems but have
a hard time solving them .. just kidding. Thanks again
for the advice.
 
K I gave it a shot and I keep getting a Compile Error
message ByRef argument type mismatch it is in the
stWordDir in MergeSingleWord stWordDir,True

I placed this behind the button

stWordDir = strBackEndPath & "WordTemplates"
MergeSingleWord stWordDir,True

and this in a Module

Function strBackEndPath() As String

Dim mytables As TableDef
Dim strTempBack As String
Dim strFullPath As String
strFullPath = ""

For Each mytables In CurrentDb.TableDefs
If Left(mytables.Connect, 10) = ";DATABASE=" Then
strFullPath = Mid(mytables.Connect, 11)
Exit For
End If
Next mytables

strBackEndPath = Left(strFullPath, Len(strFullPath) -
Len(Dir(strFullPath)))

'strBackEndPath = strBackEndPath & "rides.mde"

'MsgBox (strBackEndPath)

End Function

any ideas?
 
Curt said:
K I gave it a shot and I keep getting a Compile Error
message ByRef argument type mismatch it is in the
stWordDir in MergeSingleWord stWordDir,True

I placed this behind the button


stWordDir = strBackEndPath & "WordTemplates"
MergeSingleWord stWordDir,True

You buttion code needs to always define the variables used. So, try:

dim stWordDir as string

stWordDir = strBackEndPath & "WordTemplates"
MergeSingleWord stWordDir,True

We could I suppose not define our variable stWordDir and used:

MergeSingleWord (strBackEndPath & "WordTemplates"),True
 
Back
Top