________________________________
John Marcum
Sr. Desktop Architect
Bradley Arant Boult Cummings LLP
________________________________

From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On 
Behalf Of Mathieu Kindelberger
Sent: Wednesday, September 04, 2013 8:42 AM
To: scripting@lists.myitforum.com
Subject: [scripting] RE: Pin Taskbar Shortcuts

Hi John,
You can used 3 ways for it.

*         You can check version with Wmi and class : Win32_Product. You need to 
do an query for list only "Microsoft Office " and you read property Version.  I 
think return process of  Win32_Product query can be long in duration. If you 
have an computer with lot of software.

*         You can check with registry : HKLM\SOFTWARE\Microsoft\Office\

*         You can use Office Object and return Version.

Option Explicit

Function GetOfficeVer()
On Error Resume Next
Dim ObjectWord,strVersiontemp
strVersiontemp = 0
Set ObjectWord = CreateObject("Word.Application")
strVersiontemp =  ObjectWord.Version
ObjectWord.Quit
Set ObjectWord = Nothing
GetOfficeVer = strVersiontemp
End Function

wscript.Echo GetOfficeVer

Best regards


From: listsad...@lists.myitforum.com<mailto:listsad...@lists.myitforum.com> 
[mailto:listsad...@lists.myitforum.com]<mailto:[mailto:listsad...@lists.myitforum.com]>
 On Behalf Of Marcum, John
Sent: mercredi 4 septembre 2013 14:56
To: Scripting List 
(scripting@lists.myITforum.com<mailto:scripting@lists.myITforum.com>)
Subject: [scripting] Pin Taskbar Shortcuts

I have a script that someone wrote that's used to pin Office 2010 shortcuts to 
the taskbar. Some of my computers have Office 2007 and others have 2010. Can 
someone please show me how to make the script determine which version of Office 
is on the machine and pin the appropriate items to the taskbar?

On Error Resume Next

Const CSIDL_COMMON_PROGRAMS = &H17
Const CSIDL_PROGRAMS = &H2
Set objShell = CreateObject("Shell.Application")
Set objAllUsersProgramsFolder = objShell.NameSpace(CSIDL_COMMON_PROGRAMS)
strAllUsersProgramsPath = objAllUsersProgramsFolder.Self.Path

Set objACCFolder = objShell.Namespace(strAllUsersProgramsPath & "\Accessories")
Set objOFFFolder = objShell.Namespace(strAllUsersProgramsPath & "\Microsoft 
Office")
Set objRootFolder = objShell.Namespace(strAllUsersProgramsPath & "\")

Set objRootFolder2 = objRootFolder.ParseName("Windows Media Player.lnk")
Set colROOTVerbs2 = objRootFolder2.Verbs
For Each objVerb in colROOTVerbs2
    If Replace(objVerb.name, "&", "") = "Unpin this program from taskbar" Then 
objVerb.DoIt
Next

Set objOFFFolder1 = objOFFFolder.ParseName("Microsoft Outlook 2010.lnk")
Set colOFFVerbs1 = objOFFFolder1.Verbs
For Each objVerb in colOFFVerbs1
    If Replace(objVerb.name, "&", "") = "Pin to Taskbar" Then objVerb.DoIt
Next

Set objOFFFolder1 = objOFFFolder.ParseName("Microsoft Word 2010.lnk")
Set colOFFVerbs1 = objOFFFolder1.Verbs
For Each objVerb in colOFFVerbs1
    If Replace(objVerb.name, "&", "") = "Pin to Taskbar" Then objVerb.DoIt
Next

Set objOFFFolder1 = objOFFFolder.ParseName("Microsoft Excel 2010.lnk")
Set colOFFVerbs1 = objOFFFolder1.Verbs
For Each objVerb in colOFFVerbs1
    If Replace(objVerb.name, "&", "") = "Pin to Taskbar" Then objVerb.DoIt
Next


________________________________
John Marcum
Sr. Desktop Architect
Bradley Arant Boult Cummings LLP
________________________________


________________________________

Confidentiality Notice: This e-mail is from a law firm and may be protected by 
the attorney-client or work product privileges. If you have received this 
message in error, please notify the sender by replying to this e-mail and then 
delete it from your computer.

=====================
Is managing company email taking up way too much time?
Let users manage archived email through Outlook and drastically
reduce email storage requirements.

Download trial at http://www.gfi.com/mailarchiver/?adv=930&loc=1

=====================
Is managing company email taking up way too much time?
Let users manage archived email through Outlook and drastically
reduce email storage requirements.

Download trial at http://www.gfi.com/mailarchiver/?adv=930&loc=1
________________________________

Confidentiality Notice: This e-mail is from a law firm and may be protected by 
the attorney-client or work product privileges. If you have received this 
message in error, please notify the sender by replying to this e-mail and then 
delete it from your computer.

________________________________

Confidentiality Notice: This e-mail is from a law firm and may be protected by 
the attorney-client or work product privileges. If you have received this 
message in error, please notify the sender by replying to this e-mail and then 
delete it from your computer.

=====================
Is managing company email taking up way too much time? 
Let users manage archived email through Outlook and drastically
reduce email storage requirements. 

Download trial at http://www.gfi.com/mailarchiver/?adv=930&loc=1

Reply via email to