[RESOLVED] internet explorer pagesetup
hi all!
I'm facing the following problem:
I need to change the page margin of an internet explorer document out of an excel application (for printing)
as far as I know there is the possibility of changing the PageSetup registry key, but in excel it is not possible to use a statement like 'Dim aKey As RegistryKey' :(
is there a way to use the statement above in excel or does anyone know an alternative without using the registry?
any help would be appreciated
thx
Re: internet explorer pagesetup
ok I solved it that way:
VB Code:
Sub Change_RegKey()
Dim myWSH As Object
Dim myRegKey As String
Dim myNewValue As Double
Dim myNewStringValue As String
Set myWSH = CreateObject("WScript.Shell")
'e.g. margin top
myRegKey = "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\PageSetup\margin_top"
myNewValue = (19.05 / 25.4) 'mm to inch
myNewStringValue = myNewValue
myNewStringValue = Replace(myNewStringValue, ",", ".") 'replace "," (because of regional settings)
'write new value
myWSH.regWrite myRegKey, myNewStringValue, "REG_SZ"
End Sub
:wave: