|
Post by hawthorne on Mar 15, 2013 11:30:10 GMT -5
Attempted to paste the macro in Issue 282 for pasting unformatted text but formatting remains. The macro is as follows: Sub PasteClean() Selection.PasteSpecial Link:=False, _ DataType:=wdPasteText, _ Placement:=wdInLine, _ DisplayAsIcon:=False End Sub Any suggestions?
|
|
drcard
Software Review Panel
Posts: 580
|
Post by drcard on Mar 15, 2013 21:35:06 GMT -5
Hi hawthorne,
Did you save it? Open Word Select Developer tab Click Macros Select PasteClean Click edit
Is the macro coding displayed in the editor the same as posted? What version of Word are you using?
I wrote that article and will be happy to help you get it to work.
|
|
|
Post by cenobytez on Mar 18, 2013 8:12:19 GMT -5
you can also use getplaintext a simple program that strips out any formatting of data in the clipboard. I use it all the time
|
|
|
Post by hawthorne on Mar 26, 2013 16:12:13 GMT -5
drcard- Thanks for your intercession. Here's the macro as copied Sub PasteClean() Selection.PasteSpecial Link:=False, _ DataType:=wdPasteText, _ Placement:=wdInLine, _ DisplayAsIcon:=False End Sub This seems to agree with your original code and what I previously posted. As a test, I copied 'Bold' and then hit the icon I had assigned to the macro. It pasted 'Bold'; i.e., with bold and italic formatting. I have Word 2007. If you get into macros, be kind. I wrote one about 5 years ago but I'm not at all familiar with its conventions.
|
|
drcard
Software Review Panel
Posts: 580
|
Post by drcard on Mar 26, 2013 20:24:36 GMT -5
Hi hawthorne,
The macro causes the text pasted to use the formatting at the point in the document where the pasting occurs. Try the following to demonstrate how it works:
Copy some text Open a new Word document Note where the flashing line cursor is in the document Under the home tab change the font and font size to something different than the font and size of what you copied. Click the macro.
The text should paste in the font and size that you selected from the home tab. Did it?
If not, repeat the test above; but instead of clicking the macro select Paste drop down list and click Paste Special In the box that opens select unformatted and OK. Did this paste with the font and size selected in this document.
Let me know the outcome.
|
|
|
Post by blueboxer on Mar 29, 2013 18:39:01 GMT -5
The phpBB registration page shows the applicant's ISP as a live link to Whois. I want to copy the link unformatted into a Kingsoft office suite Spreadsheet (xls.) Kingsoft is a very close clone of MS Office.
When I copy plain text from the registration form to the spreadsheet it's control-c, control-v, and the text appears where I've put the index box. But when I post the ISP address link, I have to use the drop-down edit menu rather than control-v, and click on "Paste unformatted", which puts the information under the edit box, which I must then bring down to pick it up, then move the assemblage back up to its proper place in line. Five mouse gestures instead of one button press is not helpful.
Can you offer a suggestion similar to the Word solution?
|
|
drcard
Software Review Panel
Posts: 580
|
Post by drcard on Mar 30, 2013 7:30:06 GMT -5
hi blueboxer, I have not used Kingsoft, but from what I have read Kingsoft can handle macros IF you have the version that has that capability. Basically the free version does not have it and the paid version does. If you have that capability, then it is a matter of recording your steps in the spreadsheet as a macro using Kingsoft's recorder. Another way to accomplish this automation is scripting. AutoHotKey is a free open source program that creates scripts from mouse and keyboard input. With AutoHotKey you can record your mouse actions and then assign a keyboard shortcut (called a hot key) to that set of mouse actions. Thus when the hot key is entered the script runs the exact sequence of those mouse actions. Nice thing about AutoHotKey and scripting is it will run in applications without VBA (the macro language). Here is the link for AutoHotkey www.autohotkey.com/
|
|
|
Post by blueboxer on Mar 30, 2013 21:31:58 GMT -5
Naturally my edition is the freebie, which is proving more than adequate for my purposes. But that AutoHotKey program looks worth checking out.
Thanks for a most useful tip.
|
|
|
Post by hawthorne on Mar 31, 2013 8:50:03 GMT -5
Hi Drcard- Yes that was the problem. It worked fine from a source other than the Word document into which it was being pasted. (Haven't yet determined any limiting parameters on the format of the source). I guess it also was working for me when cutting and pasting in same document but the unformated nature was masked when it was inserted and it assumed existing format. Incidentally looked into cenobytez's suggestion of "getplaintext" but the almost unending attempts to insert other (and unwanted) programs forced me to pull the plug. Thanks for resolving my issue.
|
|