By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,508 Members | 2,949 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,508 IT Pros & Developers. It's quick & easy.

hyperlink address on rich textbox control - Any possibilty ?

P: n/a
Please help .

I want to load the contents of another rtf document by double-clicking
the words .

Chapter1.rtf
Chapter2.rtf
Chapter3.rtf
....

If I click / double click Chapter1.rtf then the contents of the
current rtf is changed by the content of chapter1.rtf .
I could do it only with the first document on the list . if I tried to
load chapter2.rtf , chapter1.rtf is always loaded . obviously my
code always read the first link on current document . I used rtf.find
..

Anybody can tell me how to do it ?

I tried using hyperlink but does not work either .

Hermawih .
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
hermawih wrote:
Please help .

I want to load the contents of another rtf document by double-clicking
the words .

Chapter1.rtf
Chapter2.rtf
Chapter3.rtf
...

If I click / double click Chapter1.rtf then the contents of the
current rtf is changed by the content of chapter1.rtf .
I could do it only with the first document on the list . if I tried to
load chapter2.rtf , chapter1.rtf is always loaded . obviously my
code always read the first link on current document . I used rtf.find
.

Anybody can tell me how to do it ?

I tried using hyperlink but does not work either .

Hermawih .


From the Access help file

strInput = InputBox("Enter a valid address")
Application.FollowHyperlink strInput, , True

Are your rtf's stored as hyperlinks. Let's say you created a table and
had a hyperlink field called rtfhyper.
Me.rfthyper = "Press Me#C:\Temp\Chapter1.rtf#"

I use code, found in the API section at http://www.mvps.org/access to
open a file based on the associated extension instead of hyperlinks.
Nov 13 '05 #2

P: n/a
Thanks Salad ,

What I really want is creating the same functionality as Ms Word for
hyperlink . To make things simple let's just forget about storing it
on table . To simulate what I did ,

1. Create form in Ms Access and name it frmRTF
2. Put rich textbox control on that frmRTF and name it rtfLink .
3. Create 4 rtf documents using wordpad or ms Word and name it TOC.rtf
, chapter1.rtf , chapter2.rtf and chapter3.rtf .
4. Load TOC.rtf and write :
Chapter1.rtf
Chapter2.rtf
Chapter3.rtf .

5. When we click or double click Chapter1.rtf , it should load
chapter1.rtf on that rtfLink . When we double click Chapter2.rtf , it
should load chapter2.rtf
etc ...

6. So far , I can only load Chapter1.rtf because it is on the first
item on the list . If I double click Chapter2.rtf or Chapter3.rtf ,
what is loaded is always chapter1.rtf .

7. Actually it does not matter whether I used hyperlink or not because
What is important is the name of the document to load ( Chapter1.rtf ,
.... Chapter3.rtf ). So the most important thing , when someone double
click that word , the program should be aware what word has been
double-clicked because if we knew what ones double-clicked , we can
just use LoadFile method . LoadFile(chapter2.rtf) .

8. My problem is knowing what to load when the words is double_clicked
..
9. I have already given up looking up the solution - Unless , someone
can give me another tips on how to solve this thing .

Hermawih

---------------
Salad <oi*@vinegar.com> wrote in message news:<SS*****************@newsread3.news.pas.earth link.net>...
hermawih wrote:
Please help .

I want to load the contents of another rtf document by double-clicking
the words .

Chapter1.rtf
Chapter2.rtf
Chapter3.rtf
...

If I click / double click Chapter1.rtf then the contents of the
current rtf is changed by the content of chapter1.rtf .
I could do it only with the first document on the list . if I tried to
load chapter2.rtf , chapter1.rtf is always loaded . obviously my
code always read the first link on current document . I used rtf.find
.

Anybody can tell me how to do it ?

I tried using hyperlink but does not work either .

Hermawih .


From the Access help file

strInput = InputBox("Enter a valid address")
Application.FollowHyperlink strInput, , True

Are your rtf's stored as hyperlinks. Let's say you created a table and
had a hyperlink field called rtfhyper.
Me.rfthyper = "Press Me#C:\Temp\Chapter1.rtf#"

I use code, found in the API section at http://www.mvps.org/access to
open a file based on the associated extension instead of hyperlinks.

Nov 13 '05 #3

P: n/a
hermawih wrote:
Thanks Salad ,

What I really want is creating the same functionality as Ms Word for
hyperlink . To make things simple let's just forget about storing it
on table . To simulate what I did ,

1. Create form in Ms Access and name it frmRTF
2. Put rich textbox control on that frmRTF and name it rtfLink .
3. Create 4 rtf documents using wordpad or ms Word and name it TOC.rtf
, chapter1.rtf , chapter2.rtf and chapter3.rtf .
4. Load TOC.rtf and write :
Chapter1.rtf
Chapter2.rtf
Chapter3.rtf .

5. When we click or double click Chapter1.rtf , it should load
chapter1.rtf on that rtfLink . When we double click Chapter2.rtf , it
should load chapter2.rtf
etc ...

6. So far , I can only load Chapter1.rtf because it is on the first
item on the list . If I double click Chapter2.rtf or Chapter3.rtf ,
what is loaded is always chapter1.rtf .

7. Actually it does not matter whether I used hyperlink or not because
What is important is the name of the document to load ( Chapter1.rtf ,
... Chapter3.rtf ). So the most important thing , when someone double
click that word , the program should be aware what word has been
double-clicked because if we knew what ones double-clicked , we can
just use LoadFile method . LoadFile(chapter2.rtf) .

8. My problem is knowing what to load when the words is double_clicked
.
9. I have already given up looking up the solution - Unless , someone
can give me another tips on how to solve this thing .

Hermawih


I didn't know that entering a word, like "Chapter1.RTF", in an RTF
control would make this a hyperlink to open up Chapter1.RTF.

I'd probably create a form to create a hyperlink. The first field would be
Display To User Text
and in that field people would enter Chapter 1, Chapter 2, etc.

The other field would be the filename. I would create a command button
to select the file name associated with the display text. There's a
File/Open dialog API call at http://www.mvps.org/access/api/api0001.htm.
The user would select the file and you'd store that in the Filename
field. Now you can write it to a table.

Create a table with a bookid and hyperlink field. You can add records
like this below.

Dim rst As REcordset
set rst = currentdb.openrecordset("Hyperlinks",dbopendynaset )
rst.addnew
rst.BookID = Me.BookID
rst.DocHypper = Me.DisplayToUserText & "#" & Me.FileName & "#"
rst.Update
rst.close
set rst = Nothing

This shows you how to add the record. Now, your form could be a
form/subform combination. The main form may have the book name. The
subform would like to the bookid/name and list the chapters in
datasheet or continuous mode. Now simply click on the hyperlink to open
the chapters.

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.