Open new notepad and insert some text without saving it in file
古いコメントを表示
I know that I can launch notepad from command:
!notepad
and I know that possible to open some existent text file by next way:
!notepad PathFile.extencion
But I want just to open notepad and automaticaly put in this window some text. And do it operation every time when push the button in my gui. Then operate with some number of opened unnamed notepad windows, copying and replacing text from one window to another, and then close it without saving. Please help me find the solve if it possible! Thanx!
採用された回答
その他の回答 (1 件)
You're on your own as to how to use it, but would have to open an ActiveX server object in Matlab to attach to the API plugin to communicate with Notepad++; it doesn't have its own a la Excel, etc.
An alternative that could do either via ActiveX or .NET would be to use Word instead--overkill in functionality, probably, but assuming Office is installed it does have the interface packaged with it.
There's even a rudimentary example to get you started <work-with-microsoft-word-documents-using-net> that way.
ADDENDUM
Or, of course, the ActiveX server route works...
>> wd=actxserver('Word.Application')
wd =
COM.Word_Application
>>
OTOH,
>> np=actxserver('Notepad.Application')
Error using actxserver (line 90)
Server creation failed. Invalid ProgID 'Notepad.Application'.
>>
One can find the .Application keyword in the Excel/Word executable; did a search in notepad.exe for anything looking remotely like such with no dice; that and lack of any reference to same on MSDN or any other search leads to conclusion doesn't exist for Notepad...
3 件のコメント
Jan
2017 年 5 月 19 日
Notepad++ is something completely different than Notepad.
Zak Kankin
2017 年 5 月 19 日
dpb
2017 年 5 月 19 日
Well, it's a nontrivial thing, interprocess communication, it is... :)
I never use Notepad; presumed that the "++" was a modern OS release but I see it's apparently an open source project. Either, way, same issue holds; unable to determine from MSDN search about what sort of engine Notepad itself may support if any, which makes one suspect it doesn't.
カテゴリ
ヘルプ センター および File Exchange で Use COM Objects in MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!