Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2006

Tip: Looking for answers? Try searching our database.

can't undo when Sub EditPaste is overriden?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
saint - 22 Aug 2006 18:34 GMT
hi, i was overriding EditPaste, then after some manipulation call
Selection.Paste and pasting works fine.

However I noticed that in doing so, Undo feature is not available (grayed
out) and says "Can't Undo" instead of the usual "Undo Paste".

Should there be any code needed on the override to make this work?
Jean-Guy Marcil - 22 Aug 2006 22:37 GMT
saint was telling us:
saint nous racontait que :

> hi, i was overriding EditPaste, then after some manipulation call
> Selection.Paste and pasting works fine.
[quoted text clipped - 3 lines]
>
> Should there be any code needed on the override to make this work?

I tested your situation with:

Sub EditPaste()

ActiveDocument.Paragraphs(1).Range.Copy
Selection.Paste

End Sub

After I hit CTRL-V to paste, my undo list allowed me to undo the paste
action. In fact, the first item in the undo list was:
   VBA-Selection.Paste

So, there is something else going on. You wrote
" hi, i was overriding EditPaste, then after some manipulation call"
I would bet that the answer lies in the "some manipulation" part. We would
need to see that code (I assume you mean that those manipulations are done
through VBA).

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

saint - 23 Aug 2006 11:15 GMT
Unfortunately, the manipulation is actually done using C# (vsto). Involves a
managed object. It is in the C# that I call Selection.Paste

I tested Selection.Paste in VBA and works fine indeed, I removed any
manipulation in the c# method called and just included Selection.Paste but
still no luck.

> saint was telling us:
> saint nous racontait que :
[quoted text clipped - 25 lines]
> need to see that code (I assume you mean that those manipulations are done
> through VBA).
saint - 23 Aug 2006 11:29 GMT
You're right. I think I was doing something wrong when I tested
Selection.Paste in C#. Now it displays Undo VBA-Selection.Paste if that's the
only code in the method called. So it must be in the "manipulation" section.

I'll guess I now have to figure out what is really causing it.

Thanks a lot.

> Unfortunately, the manipulation is actually done using C# (vsto). Involves a
> managed object. It is in the C# that I call Selection.Paste
[quoted text clipped - 32 lines]
> > need to see that code (I assume you mean that those manipulations are done
> > through VBA).
Jean-Guy Marcil - 23 Aug 2006 20:33 GMT
saint was telling us:
saint nous racontait que :

> You're right. I think I was doing something wrong when I tested
> Selection.Paste in C#. Now it displays Undo VBA-Selection.Paste if
> that's the only code in the method called. So it must be in the
> "manipulation" section.
>
> I'll guess I now have to figure out what is really causing it.

Good luck.

Since you are using C#, you may want to post in the office.developer group.

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.