Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jan 2004
    Posts
    196
    Thanks
    1
    Thanked 0 Times in 0 Posts

    email as attachment (2003)

    Our accounting software here at work has a glitch and will not send out RFIs via Outlook2003. There is a Registry hack that can be changed that will fix this problem. The problem what this hack is that now if you are a member of the "Project Managers" group within our GroupPoloicy, the File-> Send-> As Attachment is disabled. I am wondering if it is possible to change the registry setting in VBA to allow an email as attachment and then set it back to the default value?

    thanks,
    jackal

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

    Re: email as attachment (2003)

    If you have sufficient permissions to change this registry setting, you can use (for example) the RegRead and RegWrite methods of the WScript.Shell object. Example for an arbitrary number (DWord) value:

    Dim lngSetting As Long
    Dim wsh As Object
    ' Create Shell object
    Set wsh = CreateObject("WScript.Shell")
    ' Retrieve current setting
    lngSetting = wsh.RegRead("HKCUSoftwareMicrosoftOffice11.0Outloo kOptionsMailUseWordMail")
    ' Change setting
    wsh.RegWrite "HKCUSoftwareMicrosoftOffice11.0OutlookOptionsMail UseWordMail", 0, "REG_DWORD"
    ' Other code
    ...
    ' Restore original setting
    wsh.RegWrite "HKCUSoftwareMicrosoftOffice11.0OutlookOptionsMail UseWordMail", lngSetting, "REG_DWORD"
    ' Destroy object
    Set wsh = Nothing

  3. #3
    2 Star Lounger
    Join Date
    Jan 2004
    Posts
    196
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: email as attachment (2003)

    The setting I need to change is:
    "HKLMSoftwareMicrosoftWindows Messaging SubsystemMAPIX"
    The group policy sets this REG_SZ value to "0", I need it to be "1" to work. I have adjusted what you provided to work. The only problem is that it seems that Excel must restart for the change to take effect. Could this be run in the personal.xls using some sort of OnOpen to change my setting, then OnClose restore the original? I am not to worried abut resetting the original, b/c our group policy refreshes every 90 min.

    thanks,
    jackal

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

    Re: email as attachment (2003)

    You could put the code in the Workbook_Open and Workbook_BeforeClose event procedures in the ThisWorkbook module of Personal.xls.

  5. #5
    2 Star Lounger
    Join Date
    Jan 2004
    Posts
    196
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: email as attachment (2003)

    I decided to go another route, b/c once the code ran, I needed to restart Excel. I exported the registry key to mapix.reg. I then edited this file to be what I wanted it to be in Notepad. Then I created a batch file that reads as follows:

    <pre>Regedit /s L:mapix.reg
    start Excel.exe</pre>


    then made a shortcut on the users desktop and changed the icon to the Excel icon.

    Thanks for the help Hans.

    thanks,
    jackal

Posting Permissions

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