Solved

Automatically generate bookmarks in a Word document (from MS Access exported report)

Posted on 2012-03-14
7
495 Views
Last Modified: 2012-06-13
I generate a report in Access 2007 regularly that needs to be converted to Word. No problem there.

I also have a standard/template set of Powerpoint slides that need to hyperlink directly to specific pages in that Word document.

My thought is to generate the report in Access, export to Word and run some sort of code that will automatically go through word looking for the first line in the report (which contains the customer name) to create a bookmark at the customer name that is the customer's name with spaces removed. The customer names rarely change (so my PowerPoint hyperlinks should be able to point to the same bookmarks in the word document, no problem), it's just the metadata for the customer that changes.

I thought the geniuses here at Experts could tell me if there is a better way of accomplishing my goal (which is to automatically regenerate the bookmarks every time in my report)... perhaps something I could put in the database to create the bookmark?

If you think the Word code is the best bet, I need help creating that code; i have no idea how to create a bookmark in code.

Thanks!
0
Comment
Question by:epuglise
  • 3
  • 3
7 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
Anytime I can create a solution that keeps everything "All in the Family" (Use 1 Office App), The easier it becomes. (again, for me at least)

You can create a Report in Access that has click-able Hyperlinks (In Report View Only)
Then send that link to the appropriate PP file.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
Something like this:
Database98.mdb
0
 

Author Comment

by:epuglise
Comment Utility
checking out the db... in the meantime i had started the following response:

I would love to eliminate a step and keep it all in one app. Let me make sure I am clear about the direction of linking and then find out more about your solution.

The Powerpoint slides have links that open the word document at a particular location.
If the power point slides were to have links to the Access Report, how do i create the "goto" place in Access?

If the links in Powerpoint go to the report in Access, what format is the Access report in... or do the links from powerpoint have to open Access, run the report, then find the correct data item?
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:epuglise
Comment Utility
Ok I see your report drives the powerpoints opening.  I need the reverse-- the powerpoint slides have links that open the access report (saved as a .doc) to a particular page...
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
Comment Utility
This is a Word macro:
Sub FindCust()
    Dim rng As Range
    
    Set rng = ActiveDocument.Range
    With rng.Find
        .Text = "MyCustomer"
        If .Execute Then
            ActiveDocument.Bookmarks.Add "bmkCustomer", rng
        End If
    End With
    
End Sub

Open in new window

0
 

Author Comment

by:epuglise
Comment Utility
Thanks Graham.... So I have 100 customers in this report-- would you recommend any efficiencies to the code snipped you gave me or should i just repeat the snippet above 100 times and replace the find text and bookmark with the appropriate customer name? (I'm wondering if there's a way to do it with CASE but I'm not a great coder...)
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
GrahamSkan,

I'll let you take this from here...

;-)

Jeff
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now