Solved

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

Posted on 2012-03-14
7
497 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
ID: 37722277
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
ID: 37722313
Something like this:
Database98.mdb
0
 

Author Comment

by:epuglise
ID: 37722328
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

by:epuglise
ID: 37722339
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
ID: 37722497
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
ID: 37722512
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
ID: 37722982
GrahamSkan,

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

;-)

Jeff
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

919 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

12 Experts available now in Live!

Get 1:1 Help Now