Open last used Power Point File

Koldo González

New Member
Hello.

I want to open the last used Power Point file, but i don´t know how to do.
I know that the last excel file (or word file) can be retrieved via something like that:
chWorkBook = chExcelApplication:Recentfiles:ITEM(1) NO-ERROR.
But this method is not available for Power Point or Access.
As the last opened Power Point file is stored in the registry, like Word´s, I suppose that should be some method to get it, but don´t know how to.

Can anybody help me?

Thanks in advance.
 

Koldo González

New Member
Thanks, for the idea Bono, i already tried but it haven´t the application.recentfile method.
I decided to take the filename from the registry, and it does work well, but the problem now i have is that diferent versions of PowerPoint have diferent registry paths: HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\PowerPoint\Recent File List
for the pp 2000, and
HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\PowerPoint\Recent File List
i think is the pp 97 path.
Do you know how can i get this path from progress?
Thanks again.
 

joey.jeremiah

ProgressTalk Moderator
Staff member
office 2k3, oe10b
this works for me

<snippet>
load "Software" base-key "HKEY_CURRENT_USER".
use "Software".

define var cFileName as char no-undo.
define var i as int no-undo init 1.

repeat:

get-key-value
section "MicroSoft\Office\11.0\PowerPoint\Recent File List"
key "File" + string(i) value cFileName.

if cFileName <> ? then
display cFileName format "x(35)".
else leave.

i = i + 1.

end. /* repeat */

unload "Software".
</snippet>

the knowledge base was invented exactly for this kind of questions
https://progress.primushosting.net/progress/esupport
 

Koldo González

New Member
Thanks, Joey, but you havent understand my question.
I already know hot to take the recent file list from the registry, and works well, no problem there, what i dont know is how to take the path of the filename in the registry itself.
What i want is to get dinamically the path for "section", in your code:

get-key-value
section "MicroSoft\Office\11.0\PowerPoint\Recent File List"
key "File" + string(i) value cFileName.

Sorry, my english is not as good as i wish.
 

joey.jeremiah

ProgressTalk Moderator
Staff member
office2k3, oe10b
give this a try

<snippet>

define new global shared var globPowerPointSection as char no-undo init ?.

if globPowerPointSection = ? then do:

run drillSection
( "Software\Microsoft\Office", "PowerPoint",
output globPowerPointSection ).

if globPowerPointSection = ? then do:

message
"PowerPoint not installed or wasn't found"
skip(1)
"Program aborted"
view-as alert-box error.
return.

end. /* still = ? */

end. /* globPowerPointSection = ? */

message
globPowerPointSection
view-as alert-box.

procedure drillSection:

define input param cSection as char no-undo.
define input param cSearchKey as char no-undo.
define output param cResultSection as char no-undo init ?.

load cSection base-key "HKEY_CURRENT_USER".
use cSection.

define var cSubKeys as char no-undo.
get-key-value section "" key "" value cSubKeys.

unload cSection.

if cSubKeys = ? then return.
cSubKeys = entry( 1, cSubKeys, "@value@" ).

if lookup( cSearchKey, cSubKeys ) > 0 then do:
cResultSection = cSection + "\" + cSearchKey.
return.
end. /* lookup > 0 */

else do:

define var i as int no-undo.

do i = 1 to num-entries( cSubKeys ):

run drillSection(
cSection + "\" + entry( i, cSubKeys ), cSearchKey,
output cResultSection ).

if cResultSection <> ? then return.

end. /* do */

end. /* else */

end procedure. /* procedure */

</snippet>



from the editor online / menu help

<quote>

If the current environment resides in the registry, the following examples return a comma-separated list of subkeys under the current environment location and all value names directly under the current environment location. The delimiter @value@ separates the subkey names from the value names.

GET-KEY-VALUE SECTION "" KEY "" VALUE MYVARIABLE

</quote>
 

joey.jeremiah

ProgressTalk Moderator
Staff member
god damn it !!! the dialog-box trimmed the spaces again
chris can you please fix it, i love my spaces, thanks

by the way koldo english isn't my native language either
i learned english from watching tv, mostly degrassi, yeah !!!
 

Koldo González

New Member
That worked!
Thanks a lot!

Seeing how you have done it now i understand... the Help menu explanations are a bit confusing for me, i think a good, commented, example helps a lot.

P.D.: I learned english hearing songs of Rock or Heavy groups... (and with Big Muzzy from the TV!) as you can suspect, my vocabulary is a bit ... limited.
 

joey.jeremiah

ProgressTalk Moderator
Staff member
yeah, this john sadd guy is one stuttering idiot
( he's the one who wrote / responsible for most of the progress docs )

if i'll ever meet him, i'll kick his ***
though he does look kind of tough, in which case i won't


besides better documentations
i think we need more video based training, like the webcasts @psdn.com

reading a thousand page book seem like alot of work for most people
watching a few videos is far more accessible

we're the tv generation, right ?

something like 12 videos on getting started with progress
and a few more focusing on different topics

it could make a real difference


joey jeremiah, degrassi
 
Top