Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2007

Tip: Looking for answers? Try searching our database.

How to send user to a particular part of a Word document from     Access/Excel?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chrisso - 26 Nov 2007 14:25 GMT
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
Helmut Weber - 26 Nov 2007 16:12 GMT
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
Chrisso - 27 Nov 2007 09:26 GMT
Thanks Helmut

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

Chrisso
fumei - 27 Nov 2007 17:59 GMT
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).
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.