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 June 23rd, 2003, 10:14 AM
mstubble mstubble is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 8 mstubble User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Word Macro question...

I am trying to create a word macro that will replace all the extended characters in a document to their html counter-parts. For example:

Or, does someone know of a program that will take a word doc and replace all the extended characters with their html counter-parts?

Symbol HTML
— —
“ “
” ”
‘ ‘
’ ’
Bold Text
Italic Text

HTML
&# 151;
&# 147;
&# 148;
&# 145;
&# 146;
<b.>whatever</b.>
<i.>whatever</i.>



I am able to replace all of the listed characters above but I cannot replace italic and bold tags and then save the macro and get it to load. I can do it manually but I need this to be automated as well.

In other words, I setup the macro with all the settings and test and it works fine but as soon as I close out word and open back up the macro it works fine on everything but replacing bold and italic tags.

Here is my code for those sections:

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = "<i>^&</i>"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With


I think I need to specify some kind of character in the " .Text = "" area of my examle code above to get bold and italics to work correctly.

Can anyone help me with this or point me to a macro that has already done this?

Last edited by mstubble : June 23rd, 2003 at 10:47 AM.

Reply With Quote
  #2  
Old June 23rd, 2003, 10:00 PM
mohecan mohecan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Melbourne, Australia
Posts: 212 mohecan User rank is Private First Class (20 - 50 Reputation Level)mohecan User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Depending on what you are trying to achieve, you can use the Word "Save As" feature, and select web document.
__________________
How can I soar like an eagle when
I'm flying with turkey's?

Reply With Quote
  #3  
Old June 24th, 2003, 09:12 AM
mstubble mstubble is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 8 mstubble User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Well, I kind of just stated what I am trying to do and the 'save as' feature will not do anything for me in regard to my problem.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Word Macro question...


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 3 hosted by Hostway