Can I hyperlink to a MS Word bookmark?

GaryD
Member Posts: 66
Hello, we've got NAV 5.1 with SQL Server 2005. We're able to open a Microsoft Word document using a Hyperlink in NAV like this:
HYPERLINK('file:///c:\tmp\doc1.docx');
This also works:
HYPERLINK('c:\tmp\doc1.docx');
However, what we want is to be able to open up the document to a certain point where we've put a bookmark. After creating the bookmark called "test2" in Word, I tried the following code in NAV:
HYPERLINK('file:///c:\tmp\doc1.docx#test2');
and get the error:
You tried to hyperlink to this target:
file:///c:\tmp\doc1.docx#test2
Do you want to place that hyperlink target on the clipboard?
Is it not possible to open a Word document to a particular bookmark?
Thanks!
HYPERLINK('file:///c:\tmp\doc1.docx');
This also works:
HYPERLINK('c:\tmp\doc1.docx');
However, what we want is to be able to open up the document to a certain point where we've put a bookmark. After creating the bookmark called "test2" in Word, I tried the following code in NAV:
HYPERLINK('file:///c:\tmp\doc1.docx#test2');
and get the error:
You tried to hyperlink to this target:
file:///c:\tmp\doc1.docx#test2
Do you want to place that hyperlink target on the clipboard?
Is it not possible to open a Word document to a particular bookmark?
Thanks!
0
Answers
-
I don't have any personal knowledge - but perhaps you can find something to help you here:
http://msdn.microsoft.com/en-US/library/5ykkex00(v=VS.80).aspx0 -
Thanks but the bookmark is not the issue. We've created the bookmarks directly in the Word document. I just need a way for NAV to open the document to the topic (bookmark) we want but that seems to not be possible using Hyperlink.0
-
Since it seems that this may not be possible using the Hyperlink function, I looked into Word automation and was able to do what I wanted with that. FYI, here's what I did, as a test, after creating a bookmark called "Test1" in a Word document:
- create the needed automation objects: application, document, and bookmark
- open the document then go to the bookmark
Here's the pertinent code:
WDoc := WApp.Documents.Open(FilePath);
BK := 'Test1';
WSBookmarks := WDoc.Bookmarks;
WSBookmark := WDoc.Bookmarks.Item(BK);
WSBookmark.Select;
Thanks!0 -
Perhaps this belongs in the tips & tricks section!0
-
[Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Tips & Tricks' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
The Hyperlink you have specified has syntax error
it should befile:///c:/tmp/doc1.docxfile:///c:\tmp\doc1.docx
Try this and let us know if it helped!!0 -
GaryD wrote:, I looked into Word automation and was able to do what I wanted with that.
He mentions he got what he needed already.
It's also been marked as solved.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions