Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Every Machine I need to go Refernces and choose microsoft word 10.0

Status
Not open for further replies.

chaft

Technical User
Feb 7, 2008
55
GB
Help

I have to install my database on many machines soon and for
each machine I have to go to VB and go to references and
choose Microsoft word 10.0. In order to get a calendar function to work.

I have Microsoft word 11.0 on my machine,


is there a way to
automatically set this? so I don't have to go into code in
every machine I install this?

thanks
 
Hi chaft,

Well, 2 ideas here.
1) Open the references and manually select the reference for Word 10 on your machine. This may or may not work

or

2) Go to a PC that insists you fix the Word 10 reference.
Just fix the reference on this PC and then use that 'fixed' mdb as the version you copy to each user's desk top.

Hope This Helps,
Hap...


Access Developer [pc] Access based Accounting Solutions - with free source code
Access Consultants forum
 
I usually use late binding when calling other Office apps (Word, Excel). Remove the reference to Word.

Then in your code, declare all Word variables as Object.

Use CreateObject to initialize your Word application variable, i.e.

Dim MyWordApp As Object
Set MyWordApp = CreateObject("Word.Application")

Technically, late binding is somewhat less efficient. On a practical level, nobody will notice the difference and it will save you the trouble of making different versions depending on what is installed on the user's machine.

 
Copy this into a new module. It will loop through the references and inform if they are "missing". Joe-at-work's method should also work.

Sub ReferenceInfo()
Dim strMessage As String
Dim strTitle As String
Dim bytButtons As Byte
Dim refItem As Reference

On Error Resume Next

For Each refItem In References
If refItem.IsBroken Then
strTitle = "MISSING Reference"
strMessage = "Missing Reference:" & vbCrLf & refItem.FullPath
bytButtons = 16 'critical symbol
Else
strTitle = "Displaying References and Their Locations"
strMessage = "Reference: " & refItem.Name & vbCrLf & _
"Location: " & refItem.FullPath
bytButtons = 64 'information symbol
End If

MsgBox prompt:=strMessage, Title:=strTitle, Buttons:=bytButtons

Next refItem

End Sub
 
chaft,
As JoeAtWork pointed out you can use late bound objects, this is usually what I do, but you may see a minor performance hit at run time and will have no intellisense at design time.

If you want to take bubba100's concept one step further, once you determine that a library is missing you can add a reference at run time. Take a look at [tt]AddFromGuid[/tt] or [tt]AddFromFile[/tt].

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
I'm going to try Hap's007 2nd idea. Sounds easy enough and sounds like it will work..will report on it's success or not

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top