In Access
I am on a particlat record, "a persons name" say "Smith"
I want to click a button in an Access form
open a word doc which has a large calendar with a peoples directory. launch the "find macro" passing the name "smith" to it which will then hightlight them in the directory so I can change their data.
Access VBAcode lanuches Word
Word macro finds text
how can I do this?
is there a way to pass command-line variables like you can with Access?
DougP
I am on a particlat record, "a persons name" say "Smith"
I want to click a button in an Access form
open a word doc which has a large calendar with a peoples directory. launch the "find macro" passing the name "smith" to it which will then hightlight them in the directory so I can change their data.
Access VBAcode lanuches Word
Code:
Dim WordAppLocation, DocName, Macroname As String
Dim x As Object
WordAppLocation = "C:\Program Files\Microsoft Office\Office11\WINWORD.EXE"
DocName = "\\foc01\SharedDir\Calendar School\2011-2012\calendar 2011-2012-Final.doc"
Macroname = "FindText"
x = Shell(WordAppLocation & " " & DocName & "m/" & Macroname, vbMaximizedFocus)
Word macro finds text
Code:
Sub FindText(nameTofind)
With Selection.Find
.Text = "smith" 'nameTofind < be changed when it works
'.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute
End Sub
how can I do this?
is there a way to pass command-line variables like you can with Access?
DougP