Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Feb 2001
    Location
    Auckland, North Island, New Zealand
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Distribute macro package

    Edited by HansV to make URL clickable - see <!help=19>Help 19<!/help>

    As practising teacher and amateur VBA programmer, I've developed a set of macros and routines controlled by an additional toolbar. It is called "TextWand" and it enables text projected from Word onto a screen to be manipulated with the click of a button. For example it can be underlined, bordered, made to "disappear" etc.

    You can learn more about it and see a short demonstration here:

    http://mrbrook.net/textwand/Instructions.htm

    The template containing TextWand can also be downloaded from the site.

    (Here I would like to add my thanks to various people on this forum who have been prepared and able to help me during the development of TextWand. Some of the code, if you look at it, will contain solutions which are derived from your suggestions.)

    This a non-commercial product, free for use to non-commercial users.

    However, as well as inviting comments and suggestions, I have come to ask for further advice. The routines work well on my computers because I have macros set to low security. On the machines of others this may not be the case and I don't want to advise people to drop their level of security.

    The answer seems to be to apply a security certificate. Could somebody who has been down this track please suggest what is the best, quickest and least expensive route to achieve this?

    Thanks for any suggestions and advice.

    Jim Brook

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Distribute macro package

    I moved your post from the Windows 2003 forum to the Word forum because it is about distributing Word macros.

    Note: when I looked at your website, I noticed that the page has a generic title "New Page 3" (this is displayed in the title bar of the browser window). This can easily be changed in the HTML source code - the title is specified near the beginning in the line

    <title>New Page 3</title>

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Distribute macro package

    If users tick the check box "Trust all installed add-ins and templates" in the Trusted Sources tab of Tools | Macro | Security, they shouldn't have problems with macro prompts.

    Users could also store the template in their startup folder for Word. The toolbar will then be available whenever they start Word, in all documents.

  4. #4
    Star Lounger
    Join Date
    Feb 2001
    Location
    Auckland, North Island, New Zealand
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Distribute macro package

    Thanks Hans. That would seem to be the answer... I didn't know that any installed templates were exempt from the security net; I'm sort of surprised about that actually. Some users who don't know much about Word had been just downloading to the desktop but of course that isn't a trusted location. I'll update the instructions accordingly. I've already done the title page - thanks again.
    JimB.

  5. #5
    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: Distribute macro package

    Another option is to create an installer, using a tool such as InnoSetup. This post has an example of how to store a template in the user's templates folder; you could instead direct it to the startup folder if that's more appropriate: Re: Inno Setup Scripts (Any).

  6. #6
    Star Lounger
    Join Date
    Feb 2001
    Location
    Auckland, North Island, New Zealand
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Distribute macro package

    Thank you! That works really well.

    Do you know if there is a way of describing the user's file location as defined in Tools/Options/File Locations?

    Jim

  7. #7
    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: Distribute macro package

    I think Word uses the default "personal" files location (My Documents) unless the user specifies otherwise. If the user specifies otherwise, there should be a DOC-PATH value under this key:

    HKEY_CURRENT_USERSoftwareMicrosoftOffice11.0WordOp tions

    (Depending on Office version, of course, that is for Word 2003.)

    You could try the Pascal-like scripting function to copy the file from an initial application folder to the correct template folder (rough example below, not actually tested). Or you could try a scripted constant, which I don't understand from the help file...

    Code:
    [Files]
    Source: "MYTEMPLATE.DOT"; DestDir: "{app}"; AfterInstall: CopyTemplate
    Your CopyTemplate procedure probably would use at least this loop:

    Code:
    var
    	FinalDest: String;
    begin
    	// Determine copy destination
    	if RegValueExists(HKEY_CURRENT_USER, 'SoftwareMicrosoftOffice11.0WordOptions', 'DOC-PATH') then
    		RegQueryStringValue(HKEY_CURRENT_USER, 'SoftwareMicrosoftOffice11.0WordOptions', 'DOC-PATH', FinalDest)
    	else
    		use value in {userdocs} somehow;
    	// Copy file to FinalDest using FileCopy() function
    end;
    Sorry I don't have more time to think this through or experiment. Look forward to your further thoughts.
    Last edited by jscher2000; 2011-11-23 at 15:38. Reason: Fixed code tags.

Posting Permissions

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