View Single Post
  #9  
Old August 5th 08, 02:30 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Handle different international time zones for Item.Start and I

It shouldn't if WSH is installed already. I never get that prompt when
instantiating a WSH object.

What happens if you try that line from a simple VBS file you can create
using Notepad? Do you always get the same prompt:

Set oShell = CreateObject("WScript.Shell")

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"masani paresh" wrote in message
...
Hi Ken,
I have written following steps to get the UTC value of current time by
reading reg keys. But when it executes the set oShell =
CreateObject("WScript.Shell") statement, it show the dialog box for
confirming some installation. I have to click yes then it will proceed and
works fine. Could you tell me how to make this statement to work silently.

startTime = Item.Start
endTime = Item.End
set oShell = CreateObject("WScript.Shell")
atb = "HKEY_LOCAL_MACHINE\System\CurrentControlSet\" &_
"Control\TimeZoneInformation\ActiveTimeBias"
offsetMin = oShell.RegRead(atb)
startTime = dateadd("n", offsetMin, startTime)
endTime = dateadd("n", offsetMin, endTime)

startTime = Format(startTime,"yyyy-mm-dd" & "T" & "hh:mm:ss" & "Z")
endTime = Format(endTime,"yyyy-mm-dd" & "T" & "hh:mm:ss" & "Z")
MsgBox startTime & vbcrlf & endTime

Thanks,
Paresh


Ads