• Status: Solved
  • Priority: Low
  • Security: Public
  • Views: 97
  • Last Modified:

Create tagging where we found Bold and Italic font using VBA Macro?

Hello All,
Is it possible to create tag where we found Bold and Italic Font using VBA macro?

For Ex. Hello we are using Experts-Exchange.

output should be:
Hello we are using <b> Experts-Exchange</b>.

Same as Italic

Thanks,
Amzad
0
Amzad Mohammad
Asked:
Amzad Mohammad
  • 2
1 Solution
 
NorieVBA ExpertCommented:
Amzad

Where does the text you want to do this for come from?
0
 
Amzad MohammadJava DeveloperAuthor Commented:
Hello Norie,

It will be a Word File(.docx).

Thanks
Amzad
0
 
Rgonzo1971Commented:
hi,

pls try
Sub Macro1()

With ActiveDocument.Range.Find
    .ClearFormatting
    .Font.Bold = True
    .Replacement.ClearFormatting
    .Replacement.Font.Bold = False
    .Text = ""
    .Replacement.Text = "<b>^&<\b>"
    .Forward = True
    .Format = True
    .Execute Replace:=wdReplaceAll
End With
With ActiveDocument.Range.Find
    .ClearFormatting
    .Font.Italic = True
    .Replacement.ClearFormatting
    .Replacement.Font.Italic = False
    .Text = ""
    .Replacement.Text = "<i>^&<\i>"
    .Forward = True
    .Format = True
    .Execute Replace:=wdReplaceAll
End With
End Sub

Open in new window

Regards
0
 
Rgonzo1971Commented:
A Solution
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now