Solved

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

Posted on 2012-03-14
7
501 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
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…

813 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

15 Experts available now in Live!

Get 1:1 Help Now