Can I simultaneously write on notepad.exe with macro?

Creating a macro - Writing a Script - Using the API

Can I simultaneously write on notepad.exe with macro?

Postby sokolowitzky » Thu Aug 09, 2018 6:01 am

Hello,

I already know how to export data from ods to txt files. That's not what I mean.
What I'm looking for is a simultaneous logging. I have thousands of files, they will be processed with the macro I already have set.
Now I only need one more thing, can I simultaneously write logs on notepad.exe(the classical one that is found in all windows os) ?
Like these
record 1: ...../xxx.ods is done
(a few secods later a new log appears on notepad's frame, without closing)
record 2: ...../xxy.ods is created

is this technically possible?
Ocasionally; Windows 7 Starter & Open Office 4.0.1
or Windows 8.1 & Open Office 4.0.1
sokolowitzky
 
Posts: 19
Joined: Mon Sep 15, 2014 7:34 pm

Re: Can I simultaneously write on notepad.exe with macro?

Postby Zizi64 » Thu Aug 09, 2018 6:34 am

Now I only need one more thing, can I simultaneously write logs on notepad.exe(the classical one that is found in all windows os) ?



Has the Notepad.exe any API functions? Do you know them (if even they exist)?


You can launch third party softwares from an AOO/LO macro, but you can not control them if they have not some well described API functions.

I think it: you must handle that log file (database?) directly by the AOO/LO.
What filetype must be handled (that you want handle/fill by the notepad)? Is it a pure .txt/.csv,/.tsv file or other? Have you tried to handle it directly with the AOO/LO?
Tibor Kovacs, Hungary; LO4.4.7, LO5.4.7 on Win7x64Prof.
PortableApps, winPenPack: LO3.3.0-LO6.1.0 and AOO4.1.5
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 7000
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Can I simultaneously write on notepad.exe with macro?

Postby JeJe » Thu Aug 09, 2018 8:40 am

If you type - visual basic 6 send text to notepad - into google it gives you some code.

OOBasic is similar to VB6 - but VB6 has a much bigger code base, where you can find solutions for things like your question.
Openoffice 4.1.2
Windows 8
JeJe
 
Posts: 232
Joined: Wed Mar 09, 2016 2:40 pm

Re: Can I simultaneously write on notepad.exe with macro?

Postby musikai » Thu Aug 09, 2018 11:36 am

I would recommend the notepad alternative Notepad++
https://notepad-plus-plus.org/
It allows to have a txt opened without being locked.
So you could export your logs into a txt file that is always opened in notepad++.
Win7 Pro, Lubuntu 15.10, LO 4.4.7, OO 4.1.3
Free Project: LibreOffice Songbook Architect (LOSA)
http://struckkai.blogspot.de/2015/04/libreofficesongbookarchitect.html
musikai
Volunteer
 
Posts: 204
Joined: Wed Nov 11, 2015 12:19 am

Re: Can I simultaneously write on notepad.exe with macro?

Postby Lupp » Thu Aug 09, 2018 7:33 pm

I personally would avoid to depend on "third-party-software" in such a case. Why not write the logging data into an .ods sheet which later can be saved (exported) to plain text in .csv style?
On Windows 10: LibreOffice 6.1 and older versions, PortableOpenOffice 4.1.5 and older, StarOffice 5.2
---
Lupp from München
User avatar
Lupp
Volunteer
 
Posts: 1914
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Can I simultaneously write on notepad.exe with macro?

Postby RoryOF » Thu Aug 09, 2018 7:37 pm

Lupp wrote:I personally would avoid to depend on "third-party-software" in such a case. Why not write the logging data into an .ods sheet which later can be saved (exported) to plain text in .csv style?


Or modify the timed backup code to Save the document as plain text and intercept the Save function to cause the modified timed backup code to be used instead?
Apache OpenOffice 4.1.5 on Xubuntu 18.04 (mostly 64 bit version) and infrequently on Win2K/XP
14 October 2016 was Pooh's 90th birthday
User avatar
RoryOF
Moderator
 
Posts: 26942
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Can I simultaneously write on notepad.exe with macro?

Postby sokolowitzky » Thu Aug 09, 2018 7:59 pm

Thanks all for suggestions, informations...
The reason I prefer notepad is because this program uses very little of ram and cpu power. The sheets that I use have many complex formulas, like indirect&address, index&match, offset&range... so it takes a lot of power from the computer. So I thought if I can use the notepad it won't affect the main task's performance.
Ocasionally; Windows 7 Starter & Open Office 4.0.1
or Windows 8.1 & Open Office 4.0.1
sokolowitzky
 
Posts: 19
Joined: Mon Sep 15, 2014 7:34 pm

Re: Can I simultaneously write on notepad.exe with macro?

Postby Mr.Dandy » Mon Aug 13, 2018 2:40 pm

Create a TXT file
Open it through the shell with Notepad
OpenOffice 4.1.3 - Windows 7
User avatar
Mr.Dandy
 
Posts: 285
Joined: Tue Dec 11, 2012 4:22 pm


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 7 guests