Re: Getting from Access to Word



Public Sub newtest()


defaultDir = "C:\" 'Options.DefaultFilePath(wdDocumentsPath)
defaultDir = defaultDir '+ "Test.doc"
With Application.FileSearch
.FileName = "Test.doc"
.LookIn = defaultDir
.Execute
If .FoundFiles.Count = 1 Then
Documents.Open FileName:=defaultDir & "TEST.DOC"
Else
MsgBox "Test.doc file was not found"
End If
End With
End Sub
ok this will open a text doc named test.doc in c: drive
Public Function x()
Call newtest
End Function
this will run it
then when this is working all we have to do is assign what is in the
dropdown to these values
put this code in module and step thru it.
using the debug bar.

Lewie
Rick Brandt wrote:
"Susan H. White" <SusanHWhite@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:EC2E22E0-C804-45ED-9603-BC60B8E1D2A9@xxxxxxxxxxxxxxxx
In a form, I have a listbox based on a table that contains Section,
Subsection, Page and Pathway. What I want to have happen is that selecting
one of the lines in the listbox automatically activates the Pathway so that
the specified document comes up in WORD.

I'm just unable to do this, despite hours of frustration with macros,
coding, etc. Can anyone help?

What code are you using now? I would expect something like...

Application.FollowHyperLink Me.ListBoxName.Column(3)

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

.


Loading