Jump to content


Photo

Need help with MS Word Macro Please


  • Please log in to reply
1 reply to this topic

#1 Genfly

Genfly

    Young Padawan

  • Members
  • Pip
  • 1 posts

Posted 26 April 2010 - 10:42 AM

Can anyone please create a MS Word macro to remove or delete all text that is not in Bold in a word document?

This would really speed up note taking on on documents and journals for university. For example I plan to make relevant text Bold (ctrlB) and then use the macro to remove all the non bolded text. This would leave me with a document containing only the words that I marked as bold. This could be used by lots of students.


I will be beyond grateful if someone could do this for me.
If all goes well I plan to send an email to all students in my course. I will cite this forum and anyone who helps me with this on the bottom of the email.
Thanks in advance

Edited by Genfly, 26 April 2010 - 10:42 AM.


#2 faerrleah

faerrleah

    Young Padawan

  • Members
  • Pip
  • 4 posts

Posted 19 July 2010 - 02:05 PM

I have no specific idea but you can try the following code to delete bold text from the macro :

Sub Scratchmacro()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Font.Bold = True
.Replacement.Text = ""
.Execute Replace:=wdReplaceAll
End With
End Sub

If you want to remove the Bold formatting and leave the text you could use:
Sub ScratchmacroII()
ActiveDocument.Range.Font.Bold = False
End Sub




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users