Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

outlook versions 2

Status
Not open for further replies.

terry712

Technical User
Oct 1, 2002
2,175
GB
sorry afraid my programming skills are very poor - basically just want to get version of outlook nad then say if it's this version then do this and if it's not then do something else - i havent looked at the else part as the initila bit doesnt work - dont get an error so syntax is ok - it's just what i'm asking probably. any help appreciated - thanks


set outlook = createobject("outlook.application")

If "outlook.application" = "11.0.0.8169" then

Set objShell = WScript.CreateObject("WScript.Shell")
strDesktopFld = objShell.SpecialFolders("Desktop")
Set objURLShortcut = objShell.CreateShortcut(strDesktopFld & "\Outlook.lnk") ' Name for Shortcut to add
objURLShortcut.TargetPath = "c:\program files\microsoft office\office11\outlook.exe" ' Path for shortcut
objURLShortcut.Arguments = "/importprf \\domain\netlogon\outdef.prf"
objURLShortcut.Save


End If
 
You want to use outlook.Version instead of outlook.Application for version info
 
wot a muppet - i never noticed that even although mark has posted

set outlook = createobject("outlook.application")
WScript.Echo outlook.version

previously
 
how do you get it to work for if say i want different versions as it is a text file

ie if less than 10 run this
if between 10 and 12 (ie 11) then do this

thanks
 
A starting point:
Code:
Set outlook = CreateObject("Outlook.Application")
ver = Int(Split(outlook.Version,".")(0))
If ver < 10 Then
  WScript.Echo "2000 or below"
ElseIf ver >= 10 And ver <= 12 Then
  WScript.Echo "XP, 2003 or 2007"
Else
  WScript.Echo "? : " & ver
End If

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi,

I trying to create a WMI query that runs a 7zip command line if there is less than 10% hard disk space left.

Here is what I have so far

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colDisks = objWMIService.ExecQuery _
("Select * from Win32_LogicalDisk Where DeviceId = 'c:'")
For Each objDisk in colDisks
intFreeSpace = objDisk.FreeSpace
intTotalSpace = objDisk.Size
pctFreeSpace = intFreeSpace / intTotalSpace

percentfree = FormatPercent(pctFreeSpace)

wscript.echo percentfree

next


The bit I am missing is the bit which, if less than 10% disk space remaining then run the zip compression function I have written. It can run a wscript.echo "less than 20%" but my code


if percentfree > 10 then
wscript.echo "Less than 10%"

Doesnt seem to work

Any ideas\ help would be good,

james
 
If pctFreeSpace < 0.1 Then
WScript.Echo "Less than 10%"
End If

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top