Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-08-2020, 01:40 PM
macropod's Avatar
macropod macropod is offline Replicate the copy/paste function, without involving the clipboard Windows 10 Replicate the copy/paste function, without involving the clipboard Office 2010
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default


Why not create a custom undo record? For example:
Code:
Sub Demo()
Dim objUndo As UndoRecord
Set objUndo = Application.UndoRecord
With objUndo
  If .IsRecordingCustomRecord = False Then
  .StartCustomRecord ("Demo")
  'insert whatever processing you want to perform here
  .EndCustomRecord
End With
ActiveDocument.Undo
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 11-09-2020, 01:59 AM
alex100 alex100 is offline Replicate the copy/paste function, without involving the clipboard Windows 7 64bit Replicate the copy/paste function, without involving the clipboard Office 2016
Advanced Beginner
Replicate the copy/paste function, without involving the clipboard
 
Join Date: May 2020
Posts: 79
alex100 is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Why not create a custom undo record?
Well, this may work too, but the copy/paste function that I'd like to replicate is already integrated in a much larger macro. Switching to another solution would probably involve some other changes to this macro, and I'd like to avoid that as much as possible. Not to mention I never used Undo Record before...

The 'FormattedText' property seems perfect for what I need, only that I also need to be able to delete the original content prior to writing it back to the document, just like the copy/paste function works... you copy something with Ctrl + C, and then you are free to delete that content without automatically deleting it from the clipboard too. That's what I'm looking for.

Alex
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to copy specific formated text from Word and paste from clipboard into a console application Userx Word VBA 0 10-09-2020 05:58 AM
How to paste as a single para from clipboard having multiple paragraph PRA007 Word VBA 8 12-04-2015 04:48 AM
Replicate a function from MS Visio? CamSTAR1 Excel 0 08-20-2013 07:13 PM
If Function Challenge involving date no1texan Excel 6 07-15-2012 12:58 PM
Replicate the copy/paste function, without involving the clipboard copy without using clipboard? g48dd Excel 3 07-16-2011 10:28 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:27 AM.


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