DLLs in VBA

V

Veronica Brown

I've been around in cirdles on MSDN and feel like there must be a way to do
this...!

I've found a DLL (DSOleFile.dll, downloaded from Microsoft) that lets me
read and write the extended properties of files (not just MS Office files)
like "Author" and "Comments". Cool! But I am deploying my macros to a
large audience as a Word Add-In. How do I also deploy this DLL?

I have a system in place that lets me install all my files wherever they
need to go...but doesn't a DLL also have to be registered...?

I don't have access to the Packaging Wizard referred to in the MSDN docs.

Thanks so much!
-vb.
 
S

Steve Lang

Hi Veronica,
If you need to use the FSO to get and copy the files to the correct system
directory you will need a reference to the Microsoft Scripting Runtime
library. If you don't have a heterogeneous environment where the system 32
directory can be variable, you can just copy the file to the known one
(e.g., C:\Windows\System32).

Copy the dll to the system directory (if you use the FileSystemObject):

Dim myFSO as FileSystemObject
Dim strDir32 as string
Dim strSource as string 'this is the source of your files

Set myFSO = CreateObject("Scripting.FileSystemObject")
strDir32 = myFSO.GetSpecialFolder(SystemFolder)
myFSO.CopyFile strSource & "dsOleFile.dll", strDir32, True

'then use a shell command to register it:
Shell "RegSvr32.exe /s dsOleFile.dll" 'The "/s" switch eliminates the
confirmation message so it happens silently.

'clean up your object vars
Set MyFSO = Nothing


HTH and have a great day!

Steve Lang
 
V

Veronica Brown

You're a life saver!

I needed someone with The Big Picture to put all the pieces together! :)

Thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top