I have a text when I copy and paste it to another program that causes me an error,
Because of copying its formatting or perhaps the numbers and spaces which at the beginning of the lines
ِAs shown below (This is the text that I try to copy),
I don't want to completely delete the format, I just want to keep the bold font (Because it does not cause errors when I paste it into the program),
I want when i copy text to ignore any symbol other than English letters like this too,
Note:I can't control them, when I copy the text above then paste it in the program,
They are automatically pasted even if I don't selected them.
My question is can I solve this problem with keeping the bold text,
Is this possible or should I delete the text formatting completely?
Can I modify the text formatting before paste? Topic is solved
Re: Can I modify the text formatting before paste?
This is close, though the font was altered for some reason.
Code: Select all
F3::
oWord := ComObjActive("Word.Application"), active := oWord.ActiveDocument.Range
active.Paste
active.ListFormat.RemoveNumbers
active.Copy
Return
Re: Can I modify the text formatting before paste?
Great, thanks a lot @mikeyww , This is what I've been looking for for a long time.
But another question please,
Is it possible to execute this code without opening Microsoft Word.
But another question please,
Is it possible to execute this code without opening Microsoft Word.
Code: Select all
F3::
send, ^c
oWord := ComObjActive("Word.Application"), active := oWord.ActiveDocument.Range
active.Paste
active.ListFormat.RemoveNumbers
active.Copy
Return
Esc::ExitApp
Re: Can I modify the text formatting before paste? Topic is solved
Code: Select all
F3::
Gui, New
Gui, Font, s12 w500
Gui, Color, F8DC75
Gui, Add, Text, w320 Center, Please wait....
Gui, Show,, Working
oWord := ComObjCreate("Word.Application"), oWord.Visible := False, oWord.Documents.Add
active := oWord.ActiveDocument.Range, active.Paste
Sleep, 100
active.ListFormat.RemoveNumbers
Clipboard := "", active.Copy
Gui, Destroy
ClipWait, 0
If ErrorLevel
MsgBox, 48, Error, An error occurred while waiting for the clipboard.
Return
Re: Can I modify the text formatting before paste?
This is very useful,
Thank you very much again
Thank you very much again
Re: Can I modify the text formatting before paste?
Add to the end, to close the process.
Code: Select all
oWord.Quit(wdDoNotSaveChanges := 0)