Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-09-2011, 08:33 AM
njcloud njcloud is offline Convert html links into embedded hyperlinks Windows 7 64bit Convert html links into embedded hyperlinks Office 2010 64bit
Novice
Convert html links into embedded hyperlinks
 
Join Date: Jun 2011
Posts: 3
njcloud is on a distinguished road
Default


Wow, this works beautifully. Sorry for the long delay - but thank you Macropod!! I really appreciate all your help.
Reply With Quote
  #2  
Old 04-17-2014, 10:51 PM
Benble Benble is offline Convert html links into embedded hyperlinks Windows 7 32bit Convert html links into embedded hyperlinks Office 2010 32bit
Novice
 
Join Date: Apr 2014
Posts: 12
Benble is on a distinguished road
Default regarding the topic "Convert html links into embedded hyperlinks"

Hi Macropod!

Finally I found a script that is doing exactly what I am looking for. However I am running word2010 and I have document (xxx.doc) with embedded pictures/drawing and links like "
<a href="http://navigator.od.cssdom.com/qlm/ApplicationArchitectureDiagram/41b70962-78e3-460c-bd5d-f9d30ca6d639.html" target="_blank">Link to diagram in navigator</a>
" in the document that I would like to replace as hyperlinks (and in Italic preferably).

When I run you script I get an error on the line ".Execute Replace:=wdReplaceAll" saying "Run Time Error '5560': "The FIND What text contains a Pattern Match expression which is not valid". I have tried with another text pattern one ".text = "\<[Aa]*href=['""](*)['""]*\>(*)\</[Aa]\>" and that work but I run later into other problem in the code so I guess it must have the correct text pattern. Could the problem be that I have hyperlinks already in the document in terms of embedded pictures. See attached files. I would very much appreciate if you have time to look at my problem.
Kind regards
Benble
run time error 5560.jpg

codesnippet.jpg

part of doc.jpg
Reply With Quote
  #3  
Old 04-18-2014, 09:26 AM
Benble Benble is offline Convert html links into embedded hyperlinks Windows 7 32bit Convert html links into embedded hyperlinks Office 2010 32bit
Novice
 
Join Date: Apr 2014
Posts: 12
Benble is on a distinguished road
Default regarding the topic "Convert html links into embedded hyperlinks"

Hi Paul

Many thanks for a prompt reply, really appreciate it.
Now, the code can pass the replace instruction using either of the recommended .Text string, but I get another error saying that this command is not available: Set oFld = ActiveDocument.Fields.Add(Range:=RngTmp, Type:=wdFieldEmpty, text:="", PreserveFormatting:=False) . See attachment. I have also attached the document I am working with. It is a document that has been create from a another program in RTF format. From this program I can call Word 2010 and run i with a few macros to save it as *.doc instead. Then I open it again and use some DDE connection to add some more info. It is when I open it the second time and run the macro you wrote it fails. I really hope you can help me. Please view the field codes in thewhere you can see a number of them and I guess the are comming from the RTF document. I am not a word guru nor a VBA expert so I do not know how to get ride of them via a VBA script....

Kind Regards
Benble
Attached Files
File Type: zip run time error 4605.zip (328.9 KB, 14 views)
Reply With Quote
Reply

Tags
a href, hyperlink, macro



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert html links into embedded hyperlinks Embedded links spheon Word 1 06-07-2011 04:11 PM
convert html to text at opening etfjr Word 0 12-13-2010 11:14 AM
Can you actually write HTML and CSS in a word document and send it as an html page jackaroo Word 0 07-12-2010 07:49 AM
Word with frames, table of contents, and hyperlinks to html NHMC Word 0 12-09-2009 12:54 PM
Convert a file from HTML to WORD format weblayout view gtselvam Word 0 12-02-2008 03:53 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:36 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft