[Solved] Opening several files at OOo startup

Discuss setup / installation issues - Add a spell checker, Language pack?
Post Reply
lj22
Posts: 3
Joined: Fri Feb 22, 2008 10:40 pm

[Solved] Opening several files at OOo startup

Post by lj22 »

filesWelcome beginner. Please answer all of the questions below which may provide information necessary to answer your question.
-----------------------------------------------------------------------------------------------------------
Which version of OpenOffice.org are you using? 2.3.1
What Operating System (version) are you using? Windows XP
What is your question or comment? When starting Calc, can certain files be automatically opened also? Thank u...
Last edited by lj22 on Thu Feb 28, 2008 2:11 am, edited 1 time in total.
User avatar
Hagar Delest
Moderator
Posts: 32627
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: opening files

Post by Hagar Delest »

You can record a macro opening the files you want and then assign that macro to the Calc startup event (Tools>Customize).

Thanks to add '[Solved]' in your first post title (edit button) if your issue has been fixed.

NB: moved the thread in the Setup and Troubleshouting forum.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: opening files

Post by acknak »

A macro is one solution, but may not be required: just create a desktop shortcut that launches Calc with the specific files you want listed on the command line. Maybe some one else can give you an example--I know I've seen one here before.
AOO4/LO5 • Linux • Fedora 23
User avatar
kingfisher
Volunteer
Posts: 2123
Joined: Tue Nov 20, 2007 10:53 am

Re: opening files

Post by kingfisher »

Here's an example I use: oocalc2.3 -norestore /home/data/current/office/test/Test.ods

1. You may have to alter 'oocalc2.3' - that is the name of the executable on my system; your executable may have a different name.
2. You may want to remove '-norestore'; that is a parameter I add to stop the file "recovery" process occurring.
3. You will also have to use the path and file name required.
Apache OpenOffice 4.1.9 on Linux
User avatar
probe1
Volunteer
Posts: 277
Joined: Mon Oct 08, 2007 1:34 am
Location: Chonburi Thailand

Re: opening files

Post by probe1 »

I have a macro which opens all files in a given folder,
so if your files are all in one place, this one called startOOo may help you.

Comes attached to a Writer document with German and English documentation.

Have fun with OOo!
Cheers
Winfried

DateTime2 extension: insert date, time or timestamp, formatted to your needs
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: opening files

Post by acknak »

lj22 (PM) wrote:... Seems your suggestion would be the answer to
my problem.

However, I am not familiar with creating a shortcut that has
more than one (1) target.

I'm trying to get three (3) files to auto-open when I start
Calc. If you have time and can explain/show me what to enter
on the shortcut's command line I would appreciate it.
Sorry, I don't have ready access to a Windows system to check on the proper syntax. It will be something like kingfisher suggested, only tweaked to work on Windows. You should be able to simply add the three file locations (full path and file name) at the end of the command in the shortcut, something like:
"C:\Program Files\OpenOffice.org 2.3\program\scalc.exe" "C:\Documents and settings\user\My Documents\file1.ods" "C:\Documents and settings\user\My Documents\file2.ods" "C:\Documents and settings\user\My Documents\file3.ods"

I tried a quick search here and on oooforum, but didn't find a good example to go by--lot's of posts about creating a desktop shortcut, but none with a sample command line.

Maybe someone on Windows can help out.
AOO4/LO5 • Linux • Fedora 23
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: opening files

Post by Villeroy »

Opening *.ods in a dedicated folder should work as well:

Code: Select all

"C:\Program Files\OpenOffice.org 2.3\program\scalc.exe" "C:\Documents and settings\user\My Documents\myAutostart\*.ods"
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: opening files

Post by acknak »

Excellent idea! Does it work?

If it works, it means that you can create a special folder under "My Documents", called "myAutostart", and any time you use the special shortcut to launch Calc, it will open all the documents in that folder. So there's no need to change the shortcut when you want to change files, just change which files are in that myAutostart folder.

Very nice idea.

PS... one more possible approach: don't exit OOo. On my system, when I forget to close OOo before I shut the system down, then the next time I boot up, OOo is started again with all the same documents loaded. I'm only half serious, but it would be a nice feature to have in OOo, to have a "session" history that could include what documents were open and then re-open them for you on start-up.
AOO4/LO5 • Linux • Fedora 23
lj22
Posts: 3
Joined: Fri Feb 22, 2008 10:40 pm

Re: opening files

Post by lj22 »

unfortunately could not get that idea to work... however another person not in
this forum suggested creating a simple "batch" file targeting the files to open -
this "batch" file idea solved the problem...

THANK YOU to all in the forum that tried to help me...
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: opening files "SOLVED"

Post by Villeroy »

Please, can you post the batch, so other Windows users can adjust it to their needs?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
lj22
Posts: 3
Joined: Fri Feb 22, 2008 10:40 pm

Re: opening files "SOLVED"

Post by lj22 »

"batch" file contents:

@echo
cd "C:\Documents and Settings\LJ\My Documents" (path to file location)
start BNDS.ods (file name)
start STKS.ods (file name)
exit


add'l files can be added prior to "exit" line
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: opening files

Post by acknak »

Villeroy wrote:Opening *.ods in a dedicated folder should work as well: ...
Just to follow up on this, Villeroy made a great suggestion, but it does not work, unfortunately.

On Windows, it's up to each application to expand wildcards on the command line, and OOo does not do it. Starting OOo on Windows with a file name of "*.odt" tries to open a file with that exact name, not all the files that match that wildcard.

On Unix, the expansion of wildcards is performed by the shell, and OOo would get a list of actual matching files and it will open all of them in separate windows. On Windows, you can specify more than one file to open, but you can't specify a wildcard.

This desktop shortcut works for me (on Windows XP) to start OOo with a set of two files:
Target: "C:\Program Files\OpenOffice.org 2.3\program\soffice.exe" "My File.ods" "Another File.odt"
Start in: "C:\Documents and Settings\AV Users\My Documents\"

The files can be any mixture of document types that OOo can open.
AOO4/LO5 • Linux • Fedora 23
Post Reply