Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-10-2021, 07:55 PM
RobertDany RobertDany is offline Delete the current paragraph by just one click without selecting it Windows 7 64bit Delete the current paragraph by just one click without selecting it Office 2013
Novice
Delete the current paragraph by just one click without selecting it
 
Join Date: Jul 2021
Posts: 22
RobertDany is on a distinguished road
Default Delete the current paragraph by just one click without selecting it

Hi,



I want to delete the current paragraph (where the pointer located) without selecting the whole paragraph by just single click through VBA code.

Thank you
Reply With Quote
  #2  
Old 10-10-2021, 08:34 PM
gmayor's Avatar
gmayor gmayor is offline Delete the current paragraph by just one click without selecting it Windows 10 Delete the current paragraph by just one click without selecting it Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Create a macrfo with the line

Code:
Selection.Paragraphs(1).Range.Delete
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 10-10-2021, 09:55 PM
RobertDany RobertDany is offline Delete the current paragraph by just one click without selecting it Windows 7 64bit Delete the current paragraph by just one click without selecting it Office 2013
Novice
Delete the current paragraph by just one click without selecting it
 
Join Date: Jul 2021
Posts: 22
RobertDany is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
Create a macrfo with the line

Code:
Selection.Paragraphs(1).Range.Delete

Thank you for your reply

This is the VBA code for doing this purpose

Code:
Sub DeleteCurrentParagraph()
'
Selection.Paragraphs(1).range.Delete

End Sub
Thank you again Graham
Reply With Quote
Reply

Tags
find and replace, vba code, word vba

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Click in paragraph shows box with a 3-dot handle clevercat Word 6 11-01-2019 01:41 AM
Delete the current paragraph by just one click without selecting it Shortcut for selecting a paragraph paik1002 Word 2 12-13-2015 12:50 PM
Automatically Delete Slides based on current time Pacman52 PowerPoint 2 07-16-2015 05:30 AM
A macro that moves the current paragraph up or down? New Daddy Word VBA 2 04-13-2014 02:25 PM
Delete the current paragraph by just one click without selecting it Delete Current Row in protected Form joyfulincanada Word VBA 12 04-08-2013 03:37 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:44 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft