Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting Hyperlink to Word

Status
Not open for further replies.

infinitx

Technical User
Feb 26, 2004
212
US
Hi,

I want to export a hyperlink to word. Everything works, it exports the hyperlink to word, but when it is in word, it is no longer a hyperlink (no longer underlined), its just text. It looks like this: "C:\Image\Image1.jpg". How could I make it that it transfers the hyperlink while keeping its hyperlinking property? Better yet, how could that hyperlink be replaced by the image that it hyperlinks?

Thanks,
Alex
 
Take a look at the Collapse method in word.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Could you elaborate on that? How would I go about using the Collapse method and where is it located in Word?

Thanks,
Alex
 
No F2 (Object browser) nor F1 (help) key on your keyboard ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
When I do a search for "collapse", these are the results:


Collapse an outline to view a document's organization

Show only Web toolbar buttons

Compress two lines in one for East Asian text

Adjust character spacing between Japanese and Latin text or numbers

Include multiple outline numbers on a single line

Attach cascading style sheets

About reducing a picture's file size

Automatically summarize a document

Expand or collapse subdocuments



I believe there is no reference to the Collapse Method you are speaking of.




----
Alex

Anytime things appear to be going better, you have overlooked something.
 
In word go to VBE (Alt-F11)
Open the object browser pane (F2)
Enter collapse in the search box
Press F1.
The basic idea is to not destroy the bookmark's range

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Would I usie Collapse | Range? If so, what do I do with it. I tried help, but I have no clue what it is talking about and what the purpose of the Collapse feature is!

This is what help gives me:

Collapses a range or selection to the starting or ending position. After a range or selection is collapsed, the starting and ending points are equal.

expression.Collapse(Direction)

expression Required. An expression that returns a Range or Selection object.

Direction Optional Variant. The direction in which to collapse the range or selection. Can be either of the following WdCollapseDirection constants: wdCollapseEnd or wdCollapseStart. The default value is wdCollapseStart.

Remarks
If you use wdCollapseEnd to collapse a range that refers to an entire paragraph, the range is located after the ending paragraph mark (the beginning of the next paragraph). However, you can move the range back one character by using the MoveEnd method after the range is collapsed, as shown in the following example.

Set myRange = ActiveDocument.Paragraphs(1).Range
myRange.Collapse Direction:=wdCollapseEnd
myRange.MoveEnd Unit:=wdCharacter, Count:=-1
Example
This example collapses the selection to an insertion point at the beginning of the previous selection.

Selection.Collapse Direction:=wdCollapseStart
This example sets myRange equal to the contents of the active document, collapses myRange, and then inserts a 2x2 table at the end of the document.

Set myRange = ActiveDocument.Content
myRange.Collapse Direction:=wdCollapseEnd
ActiveDocument.Tables.Add Range:=myRange, NumRows:=2, NumColumns:=2

How does this allow the user to add multiple items to the same word document?

----
Alex

Anytime things appear to be going better, you have overlooked something.
 
One way of adding multiple items on a bookmark with the formating of the bookmark:
For Each Item2Insert
Code:
With wordApp
  .ActiveDocument.Bookmarks("Questions").Select
  .Selection.MoveLeft(wdCharacter)
  .Selection.InsertParagraphBefore
  .Selection.Collapse(wdCollapseEnd)
  .Selection.InsertBefore Item2Insert.Question
  .ActiveDocument.Bookmarks("Answers").Select
  .Selection.MoveLeft(wdCharacter)
  .Selection.InsertParagraphBefore
  .Selection.Collapse(wdCollapseEnd)
  .Selection.InsertBefore Item2Insert.Answer
End With
Next Item2Insert

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV,

I have one question,

Everytime I try to execute this code, it gives me the following error:

"Compile Error: Method or data member not found"

It highlights the following:

Code:
.Selection.InsertBefore Item2Insert.[b]Question[/b]

Am I supposed to replace .Question with something?

I replace Item2Insert with ex. Item Text, right?


Thanks

----
Alex

Anytime things appear to be going better, you have overlooked something.
 
Yes, Item2Insert.Question is pseudo-code for the stuff you want to insert at the relevant bookmark.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Could you give me an example of a legit code
Code:
.Selection.InsertBefore Item2Insert.Question

I want to place the Item Text in the place of the bookmark "Questions."

Thanks

----
Alex

Anytime things appear to be going better, you have overlooked something.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top