Hi All

I have a manuals for my systems in Word. At various places around my
Access and Excel systems I would like to place help icons - when the
user clicks these my VB will not only open the document but open it to
the correct heading/page that discusses the feature near the help icon
pressed.

I have found on these boards code to open the Word document. Does
anyone know the VB for then setting the users screen to a particular
part of the document? I have not tried any Word VB programming yet so
I am hoping someone out there has this sort of code lying around.

Cheers for any help,

Chrisso

Re: How to send user to a particular part of a Word document from Access/Excel? by Helmut

Helmut
Mon Nov 26 08:12:44 PST 2007

Hi Chrisso,

you may just search for specific text,
maybe plus specific formatting.

Can be recorded easily, though,
what the macro recorder records, isn't very elegant,
but might give valuable hints, what properties
the find-object provides.

Try something like that:

Sub TestA()
Dim rDcm As Range
Set rDcm = ActiveDocument.Range
With rDcm.Find
.Text = "fix"
If Not .Execute Then
MsgBox """fix""" & " was not found"
Else
rDcm.Select
End If
End With
End Sub

Or goto a specific page, like that:

Sub Test9987()
Selection.GoTo _
what:=wdGoToPage, _
which:=wdGoToAbsolute, _
Count:=18
End Sub

By the way, using PDFs as help
might be a better idea anyway.



--

Gruß

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP

Re: How to send user to a particular part of a Word document from by Chrisso

Chrisso
Tue Nov 27 01:26:36 PST 2007

Thanks Helmut

That will do nicely. I did not realise you can record macros in Word
like Excel. Excellent.

Chrisso

Re: How to send user to a particular part of a Word document from by fumei

fumei
Tue Nov 27 09:59:34 PST 2007

Not sure what form these icons are. But if they are hyperlinks, you can
easily have them open the Word document, and make it go directly to a
bookmark. For example, In Excel:

Insert a hyperlink, and make the address:

C:\MyFiles\Test\MyFileName.doc#ComeHere

Clicking the hyperlink will open the Word document C:\MyFiles\Test\MyFileName.
doc, and move the Selection to the bookmark ComeHere (no matter where it is).

--
Message posted via http://www.officekb.com