HKEY CURRENT USER - open in MODI

leemac83

New Member
Joined
Mar 21, 2006
Messages
36
Hi,

Does anyone know the code to change a HKEY for the Document Image Writer? I need to set the "OpenInMODI" to 0, which will stop the Image window opening, then need to set it back to 1, which will show the image after my Macro has finished.
I have been looking how to change the registerykey, i know what I need but am unsure how to put this into a macro. The HKEY reg is below.

HKEY_CURRENT_USER, "Software\Microsoft\Office\11.0\MODI\MDIWriter", "OpenInMODI", 0, REG_DWORD
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
something like ...... NB: youe key is diff in MDIWriter ??

Are you sure it is NOT MDI Writer

Code:
Option Explicit


Const strKey As String = "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\MODI\MDI Writer\OpenInMODI"
Const strType As String = "REG_DWORD"
Const dVal = 0

Sub ChangeXlUndoHistory()
Dim objWSH As Object

Set objWSH = CreateObject("WScript.Shell")

objWSH.RegWrite strKey, dVal, strType

Set objWSH = Nothing

MsgBox ReadRegEdit(strKey)

End Sub


'// To Read a Key
Function ReadRegEdit(key As String)
    Dim Ws, Tmp
    
    Set Ws = CreateObject("WScript.Shell")
    Tmp = Ws.RegRead(key)

    If Tmp = "" Then
        ReadRegEdit = ""
    Else
        ReadRegEdit = Tmp
    End If

    Set Ws = Nothing

End Function
 
Upvote 0

Forum statistics

Threads
1,214,611
Messages
6,120,510
Members
448,967
Latest member
screechyboy79

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top