Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Jan 2003
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Deploying ActiveX Controls (Word2002)

    My Word macros references ActiveX controls and DLLs. I am looking for an easy way to deploy these controls. I have just used the Package & Deployment Wizard, but it does not register the controls.

    Is there another /better way to do deploy ActiveX controls ?

    Thanks.
    Marie-Therese.
    <img src=/S/baby.gif border=0 alt=baby width=15 height=15>

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Deploying ActiveX Controls (Word2002)

    You could include a Readme.doc or Install.doc file with following code, invoked by an Install button on the document.

    This example requires that ActiveX control is the same source folder as the install document. The control is copied to the Windows System directory (which you could change if required), and then registered using Regsvr32.

    Private Declare Function GetSystemDirectory Lib "kernel32" _
    Alias "GetSystemDirectoryA" ( _
    ByVal lpBuffer As String, _
    ByVal nSize As Long) As Long

    Function SysDir()
    Dim sDir As String, Ret As Long
    sDir = Space(255)
    DirLen = GetSystemDirectory(sDir, 255)
    SysDir = Left$(sDir, DirLen)
    End Function

    Private Sub Install()
    Dim oFSO
    Dim strInstallFrom As String, strControlName As String
    strControlName = "FileName" ' <- Filename of the control, e.g. MyControl.ocx
    strInstallFrom = ThisDocument.Path & ""
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    On Error Resume Next
    With oFSO
    .CopyFile strInstallFrom & strControlName, SysDir
    'Include code to copy the main doc(s) to appropriate destination
    End With
    On Error GoTo 0
    Shell "Regsvr32 /s " & SysDir & "" & strControlName
    Set oFSO = Nothing
    End Sub

    Andrew C

  3. #3
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Deploying ActiveX Controls (Word2002)

    There is an installer that I use for my apps (haven't tried it with Word templates yet though) called NSIS.

    You have to learn it's scripting language (no GUI to build the installer), which is sort of a cross between C, Javascript and VBscript and...., but it's really not that hard to learn. It will allow you to do virtually anything you need an installer to do, even version checking so you don't overwrite newer files.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Deploying ActiveX Controls (Word2002)

    <P ID="edit" class=small>(Edited by jscher2000 on 14-Jan-03 15:59. )</P>I was lucky, in that the control I was distributing was self-registering. The relevant part of my setup.lst file, generated by the PD Wizard, says:

    [Setup1 Files]
    File1=@MSCOMCT2.OCX,$(WinSysPath),$(DLLSelfRegiste r),$(Shared),2/22/99 12:00:00 AM,640272,6.0.84.18

    Do you have anything comparable?

    (Honestly, I did this so long ago, I don't remember how the wizard works!)

    Second thought:

    This is what the PD Wizard did for my COM Add-in for Outlook (again, from setup.lst file):

    [Setup1 Files]
    File1=@jfsWDX01.DLL,$(ProgramFiles)jfsWDX,$(DLLSel fRegister),,10/23/01 6:34:52 PM,40960,1.1.0.2

  5. #5
    Star Lounger
    Join Date
    Jan 2003
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Deploying ActiveX Controls (Word2002)

    Thank you to everyone who gave answers to this question. I discovered that the wizard did actually register the controls, however, one of my controls which was being referenced was missing from the package.

    <img src=/S/blush.gif border=0 alt=blush width=15 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •