SunQuest
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old July 31st, 2003, 01:04 PM
tracytth tracytth is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Hayward, CA
Posts: 1 tracytth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Help! How to do "replace" on Word 97 Macro?

Please help... I been searching online for few days... still can't find anything that works.

In the code, I saw some xx.find.execute, but I have no idea how to use it, is that the old syntax for find and replace on vb?

I just want to do a simple replace inside the vb code, to change the windows \ to web / and replace the .cfm to .html. I can run the code below in Word 2002, but my client is using Word 97 to integrate with her other apps using that Word document.

I know the Word 2002 accept:
fha = Replace(fha, ".cfm", ".html")

But how to do the same thing on Word 97 macro?

Thanks first!

It's a really cool Word Macro that take word document and base on their style and then convert them into HTML with a help of a HTML template file.

Anything that has "hyperlink" style is gonna be either a image or a real hyperlink to a file.

The code:

With fnd.Find
.ClearFormatting
.Style = "Hyperlink"
.Format = True
.Execute Forward:=True, findtext:=""
fff = .Found
If fff = True Then
hlinks = hlinks + 1
fnd.Style = "Default Paragraph Font"
ft = fnd.Text
fha = LCase(fpd.Hyperlinks(hlinks).Address)
fhs = LCase(fpd.Hyperlinks(hlinks).SubAddress)
Rem: change the windows \ to web / and replace the .cfm to .html
fha = Replace(fha, "\", "/")
If InStr(fha, ".cfm") > 0 Then
fha = Replace(fha, ".cfm", ".html")
End If

Last edited by tracytth : August 1st, 2003 at 01:12 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > How to do "replace" on Word 97 Macro?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway