?
Solved

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

Posted on 2012-03-14
7
Medium Priority
?
510 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 

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 1500 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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

801 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