Wednesday, November 24, 2021

Set startup type of vmware services in windows 10 using command line

 to set the startup type manual


sc config "VMAuthdService" start= demand

sc config "VMnetDHCP" start= demand

sc config "VMware NAT Service" start= demand

sc config "VMUSBArbService" start= demand

sc config "VMwareHostd" start= demand

 

to set the startup type automatic 


sc config "VMAuthdService" start= auto

sc config "VMnetDHCP" start= auto

sc config "VMware NAT Service" start= auto

sc config "VMUSBArbService" start= auto

sc config "VMwareHostd" start= auto

Tuesday, November 2, 2021

Filtering emails using DASL query in outlook using vba

 Sub lastfewdaysusingdslquery()

Dim olApp, olAccts, olInspect, ns As Object
Dim myStoreID, myEntryID As String

Set olApp = CreateObject("Outlook.Application")
Dim olFolder As outlook.MAPIFolder
Set ns = outlook.GetNamespace("MAPI")

lastWeek = Date - 7
'strFind = "[ReceivedTime] >= '" & lastWeek & " 12:00 AM' AND [ReceivedTime] <= '" & Date & " 11:59 PM'"
strFind = "@SQL=" & Chr(34) _
& "urn:schemas:httpmail:subject" & Chr(34) _
& " = 'hello'"
MsgBox (strFind)
Set olFolder = ns.Folders("allsourav@hotmail.com").Folders("Inbox")
Set filteritems = olFolder.Items.Restrict(strFind)

MsgBox (filteritems.count)

For Each citem In filteritems

Next citem



End Sub

Search emails dynamically for the past week

 Sub lastfewdays()

Dim olApp, olAccts, olInspect, ns As Object
Dim myStoreID, myEntryID As String

Set olApp = CreateObject("Outlook.Application")
Dim olFolder As outlook.MAPIFolder
Set ns = outlook.GetNamespace("MAPI")

lastWeek = Date - 7
strFind = "[ReceivedTime] >= '" & lastWeek & " 12:00 AM' AND [ReceivedTime] <= '" & Date & " 11:59 PM'"
MsgBox (strFind)
Set olFolder = ns.GetDefaultFolder(6)
Set filteritems = olFolder.Items.Restrict(strFind)

MsgBox (filteritems.count)

For Each citem In filteritems

Next citem



End Sub

Monday, November 1, 2021

Finding an item by its unique entry in outlook using Python

 import sys, win32com.client as client, datetime
import datetime,time
# Connect with MS Outlook - must be open.
outlook=client.Dispatch("Outlook.Application")

d = (datetime.date.today() - datetime.timedelta (days=7)).strftime("%d-%m-%y")
print(d)
#olFolder = outlook.GetNamespace("MAPI").Folders("allsourav@hotmail.com").Folders("Sent Items")
#itmemail = outlook.Createitem(0)
#messages = olFolder.Items
ns = outlook.GetNamespace("MAPI")
olFolder = ns.Folders("allsourav@hotmail.com").Folders("Sent Items")

myStoreID = olFolder.StoreID
myEntryID = "00000000252E983297E98F47B95403F4214B120D0700F0072D28E9944441ACCC552F18B27F6A0000000001090000F0072D28E9944441ACCC552F18B27F6A00038DE5ED3E0000"
msg = ns.GetItemFromID(myEntryID, myStoreID)

#Debug.Print foundmail.Subject, foundmail.SenderName, foundmail.ReceivedTime


print (msg.Subject,msg.SentOn.strftime("%d-%m-%y"),msg.SenderName)



Finding an item by its unique entry in outlook using VBA

 Sub finditem_byuniqueentry()




Dim olApp, olAccts, olInspect, ns As Object
Dim myStoreID, myEntryID As String

Set olApp = CreateObject("Outlook.Application")
Dim olFolder As outlook.MAPIFolder
Set ns = outlook.GetNamespace("MAPI")
Set olFolder = ns.Folders("allsourav@hotmail.com").Folders("Sent Items")

myStoreID = olFolder.StoreID
myEntryID = "00000000252E983297E98F47B95403F4214B120D0700F0072D28E9944441ACCC552F18B27F6A0000000001090000F0072D28E9944441ACCC552F18B27F6A00038DE5ED3E0000"
Set foundmail = ns.GetItemFromID(myEntryID, myStoreID)

Debug.Print foundmail.Subject, foundmail.SenderName, foundmail.ReceivedTime



End Sub