Marcus, Scott (GEAE, RHI Consulting)
scott.marcus at ae.ge.com
Mon Apr 7 15:17:44 CDT 2003
Terri,
You could use the following code....
Dim ref as Reference
Dim strFilename as String
Dim strName as String
Din intLoc as Integer
strFilename = "c:\windows\system\mso8.dll" 'Change this to desired path
For each ref in References
strName = ref.FullPath
intLoc = 1
While intLoc <> 0
intLoc = InStr(1, strName, "\")
strName = Right(strName, Len(strName) - intLoc)
Wend
If LEFT(strName, 3) = "MSO" Then 'Find the Office object Reference
If strName <> "MSO8.DLL" Then 'See if the reference is correct
References.Remove ref 'Wrong reference so remove it
References.AddFromFile (strFilename)
Exit For
End If
End If
Next ref
I think that late binding(like Marty suggests) would be a better solution tho.
Scott
-----Original Message-----
From: MartyConnelly [mailto:martyconnelly at shaw.ca]
Sent: Monday, April 07, 2003 3:42 PM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] A97 - References
You could just use late binding then it grabs the latest version available.
Terri Jarus wrote:
You're right - olb - the one I want to keep constant is msword8.olb. We
are sharing the application over the network.
scott.marcus at ae.ge.com <mailto:scott.marcus at ae.ge.com> 04/07/03 12:02PM >>>
Do you mean 'olb' file instead of dll? Are you sharing this application
on the
network? I would guess that the file in question has a different name
per
version of word (mine is msword9.olb). You could set this reference
based on
which file you find on the computer. This wont work if you are sharing
the
application on the network.
Scott
-----Original Message-----
From: Terri Jarus [ mailto:jarus at amerinet-gpo.com
<mailto:jarus at amerinet-gpo.com> ]
Sent: Monday, April 07, 2003 11:49 AM
To: accessd at databaseadvisors.com <mailto:accessd at databaseadvisors.com>
Subject: [AccessD] A97 - References
I have several users of the same database on a network - all works
fairly well - except, now some folks have gotten new computers and new
versions of Access (AXP). They also have A97 on their computer,
because
I don't want to switch until everyone has AXP.
There is a button on a form that creates a Word document. Since
everyone does not have Word97 (many have WXP), I have copied the Word
8.0 dll (set a reference) to a shared location so that this works on
everyone's computer. However, somehow (I don't know how) the
reference
is getting changed to the Word 10 dll, which screws things up. All I
have to do is change the reference back and all is well.
Is there a way to ensure that the reference cannot be changed?
Any ideas? Let me know if this does not make sense.
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com <mailto:AccessD at databaseadvisors.com>
http://databaseadvisors.com/mailman/listinfo/accessd
<http://databaseadvisors.com/mailman/listinfo/accessd>
Website: http://www.databaseadvisors.com <http://www.databaseadvisors.com>
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com <mailto:AccessD at databaseadvisors.com>
http://databaseadvisors.com/mailman/listinfo/accessd
<http://databaseadvisors.com/mailman/listinfo/accessd>
Website: http://www.databaseadvisors.com <http://www.databaseadvisors.com>
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com <mailto:AccessD at databaseadvisors.com>
http://databaseadvisors.com/mailman/listinfo/accessd
<http://databaseadvisors.com/mailman/listinfo/accessd>
Website: http://www.databaseadvisors.com <http://www.databaseadvisors.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030407/fd1dd42b/attachment-0001.html>