Microsoft PowerPoint 2010 and Visual Basic 7.0: writing macros
Using Microsoft PowerPoint 2010, and Visual Basic 7.0, I've been trying to write a macro that will go into the same directory as the active ppt file. It should observe all the documents in the specified folder and generate a series of buttons that will create a hyperlink to each document that assembles the criteria ????.ppt.
I've found the basic logic in implementing this, but when I try to run it, the problem lies in loading an array. My researches have directed me to implement the System.IO.directory.getfiles(string, string, searchCriteria) method, but I am always getting a runtime error 424: object needed.
Here are parts of my code that are related to the problem:
myPath = ActivePresentation.Path
FileNames = Directory.GetFiles(myPath, "????.ppt")
After some additional research, I got the following in the MSDN library:
Public Shared Function GetFiles(path as string, searchPattern as string, searchOption as SearchOption) as string()
However, it is not working. Also, the compiler does not like the line of code, even though I've tried putting it in the module and in a class.
I'll confess that I am a full layman when it comes to understanding the code. My knowledge is little and only on the basic level, but I'm totally obsessed with the language right now. Please help me to solve this. Thanks a lot!