microsoft word: copy without formatting - ms-word

When I copy a text from Microsoft Word and the text is a heading in the clipboard I see it included a paragraph number. Then in another application I must remove the number manually.
Can I copy just a text without any additional information?
(The same is with Chrome when you copy a URL it adds a http:// automatically)

Method 1:-
one way is right mouse click and use this paste special option
Method 2:-
assign a shortcut(Ctrl+Shift+V) for this operation (Note: by default Ms word not set shortcut for it so we need to set it by own)
File > Options > Customize Ribbon > Keyboard shortcuts: Customize.
on Left Categories List section, click on All Commands
Under right Commands List, select for PasteTextOnly
then Set the keyboard shortcut for PasteTextOnly as Ctrl+Shift+V
Method 3 permanent/Default Settings
use this option which will each time paste as plain text by default

Try this
Sub FormatFreeTextCopy()
Dim ffText As DataObject
Set ffText = New DataObject
ffText.setText Selection.Text
ffText.PutInClipboard
End Sub
Note: You would have to Reference to Microsoft Forms Object Library

There is a generic "paste plain text" solution using autohotkey open-source automation software:
^+v:: ; Text–only paste from ClipBoard
Clip0 = %ClipBoardAll%
ClipBoard = %ClipBoard% ; Convert to text
Send ^v ; For best compatibility: SendPlay
Sleep 50 ; Don't change clipboard while it is pasted! (Sleep > 0)
ClipBoard = %Clip0% ; Restore original ClipBoard
VarSetCapacity(Clip0, 0) ; Free memory
Return
Save this code to paste_plain_text.ahk script
Install autohotkey
Execute your script
It will paste plain text using Ctrl+Shift+V shortcut. You can put your script at Startup directory so it loads on Windows startup.

Related

How to remove the word "copy" when you copy & paste a file in VSCode

When copy a file ".env", I hope to got a duplicated file named ".env 1" not ".env copy"
You can change this behavior by setting the explorer.incrementalNaming to smart.
To do that, do the following:
cmd+,
search for: explorer.incrementalNaming
Change the setting to smart.
Otherwise, if you don't want to change the setting, you can just constantly change the filename after copy is complete. The fastest and most efficient way I found is through the following keyboard commands:
Select file in Explorer
ctrl+c (or cmd+c if you're on a mac)
ctrl+v (or cmd+v)
<enter>
right arrow once
backspace 5 times
then put in 1.

AutoHotkey: How can I paste text into this particular textbox?

Using AutoHotkey, I have a very tiny script to write text:
^m::
SendInput Foo
Return
This works in most places like Notepad and chrome. However, it doesn't work for a particular program I am using. The program has a simple textbox which I can type text into. The program is called TextExpander. I am making sure the cursor is located in the textbox. For some reason, I can't get auto-hotkey to type text into it.
Any help? Tips?
You can look at ControlSetText. Use WindowSpy to check the control name. If it has one, you can use that to set the text.
Alternately, make sure you're trying SendInput/SendEvent/SendPlay.
If you have a way to reliably focus the box you're trying to enter text to, you can put your variable onto Clipboard and send paste via Ctrl+V SendInput, ^v.

AppleScript adds Enter/NewLine to clipboard when paste into Word

I'm currently trying to write an AppleScript for my Touchbar, which does copy a predefined variable into the clipboard and then pastes it into a word document.
Well, it does work, but for some reason in addition of just pasting the variable text, it also adds a Enter/NewLine to it.
Now I already did some testing and just assigned plain text directly to the clipboard and the NewLine was still there, so it isn't the variable. I also tested the Cmd+V output and also when I just paste the text manually afterwards it still pastes it with an enter, so it seems like there is something wrong with the assignment. But since I'm new to AppleScript and the language is really weird, I don't really get what I'm doing wrong here. Here is the important code part:
activate application "Microsoft Word" --I'm doing this, but you prolly don't need to.
set Donnerstag12 to "Anwendungsentwicklung"
set the clipboard to Donnerstag12
tell application "System Events" to keystroke "v" using {command down}
Now I just noticed that when I let AppleScript paste into Pages, TextEdit or straight into the code, it doesn't include a NewLine. Any Ideas?
You can use the type text command of Microsoft Word.
set Donnerstag12 to "Anwendungsentwicklung"
tell application "Microsoft Word" to type text selection text Donnerstag12
It must be something that Word is doing with it's "Smart Cut & Paste" options, though I'm not seeing that behavior in Word 2011. You can look to alter that behavior in the advanced Advanced settings. You can also just alter your script to delete the paragraph marker when you're pasting into Word.
activate application "Microsoft Word" --I'm doing this, but you prolly don't need to.
set Donnerstag12 to "Anwendungsentwicklung"
set the clipboard to Donnerstag12
tell application "System Events"
keystroke "v" using {command down}
if name of (first process whose frontmost is true) is "Microsoft Word" then key code 51
end tell

Autohotkey Script that edits selected text without using the clipboard

I want to write an Autohotkey text to edit the text that the user selects and append four spaces at the beginning of every line.
If I would simply have a string with multiple lines the task would be easy.
I googled and found one solution at the official Autohotkey forum. That solution copies the text into the clipboard potentially deleting the clipboard content.
Is there a way to do this in autohotkey that doesn't use the clipboard where I can directly operate on the selected text?
Here are some basic Clipboard techniques:
ClipSaved := ClipboardAll ; Save the entire clipboard to a variable of your choice (in this case, ClipSaved).
; Here is where you put your code
Clipboard := ClipSaved ; Restore the original clipboard.
ClipSaved = ; Free the memory in case the clipboard was very large.
More here: https://autohotkey.com/docs/misc/Clipboard.htm
Well, this one requires your mouse cursor to hover over the window with the selected text:
MouseGetPos,,,thiswindow,thiscontrol
ControlGet,VarX,selected,,%thiscontrol%,ahk_id %thiswindow%
;Do something with "VarX" here.

Change Visual Studio 2010 key binding to match eclipse?

There are plenty of people asking and solutions for going from vs to eclipse, but unfortunately I'm going the other way. I'm an eclipse fan but I have to use vs 2010 now.
Does there exist a keybindings file I can import that will give me my favorite eclipse keyboard shortcuts?
Another alternative is to use AutoHotKey.
I am totally familiar with the pain of migrating from Eclipse to VS.
Anyway here is my AHK script. Just install AHK, edit/ this script as per your visual studio version and run it. You dont need to change anything in visual studio keybindings.
there are two ways of controlling any application on windows, either direct keyboard shortcuts with CTRL/SHIFT/ALT or using the ALT to activate menu bar and further typing F for FILE, E for EDIT and so on. The following script uses both types of shortcuts and it is up to you to decide which way you want to use the shortcuts.
I use following script for visual studio express 2012 version.
; ^ stands for Ctrl
; ! stands for Alt
; + stands for Shift
SetTitleMatchMode, 2
#IfWinActive, Microsoft Visual Studio Express ;any part of the name of the window
^PgDn::Send ^!{PgDn} ; next opened doc (tab navigation shortcut like in firefox/chrome)
^PgUp::Send ^!{PgUp} ; previous opened doc (tab navigation shortcut like in firefox/chrome)
^b::Send ^{F7} ; compile the current file
^/::Send ^{e}{c} ; comment Ctrl+e+c
^+/::Send ^{e}{u} ; uncomment Ctrl+e+u
^k::Send ^{F3} ; find next Ctrl+F3
^w::Send ^{F4} ; close tab Ctrl+f4
^Enter::Send {F12} ; go to defi/decl
^!Enter::Send ^+{g} ; open file under cursor (for headers) Ctrl+g
^+Enter::Send !{e}{i}{q} ; show quick info Alt+e+i+q (Using menu bar)
!Right::Send ^+{-} ; navigate last position
!Left::Send ^{-} ; navigate next position
^e::Send !{v}{i} ; error window
^+TAB::Send !{v}{p} ; solution explorer
; add here
return
#IfWinActive
You can only change them manually in the options I believe, but once you do you can export them for anytime you want to use them again (or release them for people who want the same keybindings). Unless of course someone wants to export their settings and give them to you.