Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-15-2024, 06:49 AM
syl3786 syl3786 is offline Seeking Assistance with Word Macro to Add Transparent, Blue Line Circle Shape Windows 10 Seeking Assistance with Word Macro to Add Transparent, Blue Line Circle Shape Office 2019
Advanced Beginner
Seeking Assistance with Word Macro to Add Transparent, Blue Line Circle Shape
 
Join Date: Jan 2023
Posts: 97
syl3786 is on a distinguished road
Default Seeking Assistance with Word Macro to Add Transparent, Blue Line Circle Shape

I'm in need of some assistance regarding Word macros. Specifically, I'm wondering if it's possible to automatically add a transparent, blue line circle shape over specific text using a Word macro. 📝💻

I've explored some options, but I'm not quite sure how to approach this task. That's why I'm reaching out to this knowledgeable community for guidance and expertise.

If you have experience with Word macros or VBA (Visual Basic for Applications), I would greatly appreciate your insights. Is it feasible to achieve this goal using a macro? Are there any specific techniques or code snippets you could suggest?

My intention is to have the macro identify the specific text within a Word document and automatically overlay a transparent, blue line circle shape on top of it (see attached document) Expected Result.docx



Your assistance would be immensely valuable, and I'm eager to learn from your expertise. Thank you in advance for your support! 😊💙

My code drafted:

Code:
Sub AddCircleShape()
    Dim rng As Range
    Dim shape As Shape
    
    Set rng = ActiveDocument.Content
    rng.Find.Text = "YOUR_SPECIFIC_TEXT"
    rng.Find.Execute
    
    If rng.Find.Found Then
        Set shape = ActiveDocument.Shapes.AddShape(msoShapeOval, rng.Information(wdHorizontalPositionRelativeToPage), rng.Information(wdVerticalPositionRelativeToPage), rng.Information(wdShapeSizeWidth), rng.Information(wdShapeSizeHeight))
        With shape
            .Fill.Transparency = 0.5 ' Adjust the transparency value as desired
            .Fill.ForeColor.RGB = RGB(0, 0, 255) ' Set the color to blue; modify RGB values if needed
            .Line.Visible = msoTrue
        End With
    End If
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Seeking Assistance with Word Macro to Add Transparent, Blue Line Circle Shape Potential Clashes in Macros - Seeking Assistance yanyan9896 Word VBA 2 10-09-2023 04:59 AM
Seeking Assistance with Word Macro to Add Transparent, Blue Line Circle Shape vba code in word to delete line having inline shape anand Word VBA 7 06-18-2015 10:02 PM
Seeking Assistance with Word Macro to Add Transparent, Blue Line Circle Shape remove blue line dogbite Word 1 12-17-2014 06:23 AM
Seeking Assistance with Word Macro to Add Transparent, Blue Line Circle Shape How to write Text above the Shape Line in Ms Word 2010 tahakirmani Word 2 11-28-2013 05:33 PM
Seeking Assistance with Word Macro to Add Transparent, Blue Line Circle Shape Round Blue Circle Keeps Flashing and Circling randyflycaster Word 5 09-14-2011 07:29 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:10 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