Skip to main content

Posts

Outlook VBA search for string in email body

How to search for a string in the body of Outlook emails?

How to search for a string in Outlook emails using VBA?

How to find a string in Outlook email body using VBA?

Outlook VBA code below searches a string on the email body and move the email to a specified folder.

Replace variables below with the actual folders and string to search in Outlook:

Destination_Folder_01
Folder_to_be_Searched
string to be searched

Folder_to_be_Searched - all emails in this folder will be searched and if the string matches the will be moved automatically to the destination folder. 


string to be searched - this string will match on the body of the emails

Sub MailItemContent_Move_Search()
Dim olItem As Outlook.MailItem Dim sText As String Dim myNameSpace As Outlook.NameSpace Dim myInbox As Outlook.MAPIFolder Dim myDestFolder2 As Outlook.MAPIFolder Dim mySearchFolder As Outlook.MAPIFolder
Set myNameSpace = Application.GetNamespace("MAPI") Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox)
‘Repla…

Linux folder with special characters

Operating system or even applications programs does restrict some characters since it's either used by the system or it is not permitted for some other reasons.

In Linux special characters like ampersand, dashes and other special characters should not be used as folder names or even file names.

But some users or even IT folks violate this rule without knowing the consequences it holds.

Of course, whatever characters available on the keyboard should be used or else what's the point of having them on the keyboard. :)

But there are consequences in using those mentioned characters.

In Linux terminal, if the folder name has an ampersand on its folder name like the image below it cannot be copied easily.

For example navigating in Linux through the terminal using "cd" should be smooth but sometimes simple things can be tough if you don't know how to get around with it.


Navigating folders with special characters using "cd " command is quite simple by enclosing…

Empty log or replace large files

Log files can easily occupy the space of a drive.

If the log files is collecting or monitoring multiple system then chances are it will grow in size very quickly.

If it the log file is in a text format, even if it comes in Giga or Tera bytes size it can be emptied very quickly in a command line.

If the log files has been analyzed or not in use anymore, then it is a good candidate to get rid of it rather than occupy the space of a drive for nothing.

To empty a log file or a text file:

In Windows open command prompt and type:

echo "First Line" > Packets_2018.log

The log file will be replace with the word "First Line" and only a few bytes in size. Whatever was the content before on that log file is ditch away. So, be careful in emptying a file it's not reversible,

In Linux open Terminal and type:

echo "Line 1" > Packet_logstash.log

Till next time..Cheers!

================================ Free Android Apps:
Click  links below to find out more:
Excel Keyb…

Word header does not print correctly

Ever printed a document and set the header as 1 inch. After printing the header is adjusted and it’s not the same with the specified settings on the header.
There are numerous solutions to this single issue. Updating printer driver may help to solve this problem. Selecting the proper size of the document before printing that is same size with the paper that is on the printer. And a lot of possible solutions.
Another solution to solve this issue is to check the headers and footers on page setup. On the document click on “File”, click “Print”. On the Print window, click “Page Setup” at the bottom on this window. See image below:




On “Page Setup” window, click the “Layout” tab and adjust the “Headers and Footers” as per requirement. See image below:


After adjust to a desired setting, click “Print” and if everything goes well. Then the printing will be as expected.

Cheers..till next time.
================================ Free Android Apps:
Click  links below to find out more:
Excel Keyboard gu…

Add multiple drivers to a WinPE image

How to add multiple inf drivers to a Windows PE Image?

To add a single driver to a Windows PE Image  is quite straight forward but adding multiple drivers  one by one is not ideal or else it will take a definite amount of time.

Dism command provides an option to add a single driver or add multiple drivers.


To add a single driver or multiple drivers, the first thing to do is to mount the image for editing.

Dism /Mount-Image /ImageFile:"C:\WinPE_amd64\sources\boot.wim" /index:1 /MountDir:"C:\WinPE_amd64\mount"

C:\WinPE_amd64\media\sources\boot.wim -  is the image where the new drivers will be added

C:\WinPE_amd64\mount - this directory will contain the extracted files of wim images, the folder must be created if it doesn't exist

Once the image has been mounted, to add a single driver type the command below:

Dism /Add-Driver /Image:"C:\WinPE_amd64\mount" /Driver:"C:\Folder_Driver\driver.inf"

C:\WinPE_amd64\mount - the folder in which the mount i…

Move folders in command line with specific string

How to move folders in command line without selecting manually the folders?
Manually moving folders is quite ideal if there are two or three folders that needs to be moved. But if the folders are quite a lot and doing it manually is a bit tedious; besides chances are there might be folders that will be missed out.
Command lines and some basic editing in notepad can ease the process of moving folders it can be run via batch file or just simply enter the command at the command prompt window.
Assume that all folders have the word “old-data” as part of its folder name. It can be any string as long as it’s common to all the folders that needs to be moved or archived.
First step, is to open a command prompt window then change directory to the folders.
Example: c:\cd sales_data
Then at sales_data directory type:
dir *old-data* /s/b > file_old_data.txt
replace old-data with any string that is common to all folders.
* is used between the string, which basically means that look for folders with this …

Check if 32 bit or 64 bit processor from command line

How to check processor architecture whether its 32bit or 64bit?
One method is to query the registry from the command line.
Here’s a one liner command line that will check whether the PC processor is 32bit or 64bit.
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" | find “ARCHITECTURE”
If the output is something like this:
PROCESSOR_ARCHITECTUREREG_SZAMD64

Then it’s a 64bit, if it shows x86 then it’s a 32 bit.
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" | find “IDENTIFIER”
Above query can also identify, the output shows Intel64 for 64bit.
Sample Output: PROCESSOR_IDENTIFIERREG_SZIntel64 Family 6 Model 142 Stepping 10, GenuineIntel

Omitting the find option from the “reg query” command will show quite a few information.
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
This query command works in Windows 7, Windows 8 and Windows 10. I believe this will also work in Windows s…