How to extract PDF files inside many MSG files in a folder? - outlook

I have many outlook MSG files in a folder and inside the msg file there are PDF files attached. Is there any way to extract all the pdf files all at once so I don't have to individually open each one?

Loop through all files in the folder, for each file call Application.Session.OpenSharedItem. For the returned MailItem object, loop through the attachments (MailItem.Attachments collection) and call Attachmeent.SaveAsFile for the attachments you want to save.

Related

When a new picture is placed in a windows directory, automatically send the picture via email

I'm trying to find a solution to automatically send an email each time a new picture is placed in a folder.
Example:
C:\newpics\
When I add a new file in that folder, let's say newimage.bmp
the file 'newimage.bmp' should automatically send to myemail#example.org
You may consider creating an Outlook add-in where you may track for particular folder changes and send email automatically.
Use FileSystemWatcher can be used to watch for changes in a specified directory. You can watch for changes in files and subdirectories of the specified directory. You can create a component to watch files on a local computer, a network drive, or a remote computer.
To watch for changes in all files, set the Filter property to an empty string ("") or use wildcards ("."). To watch a specific file, set the Filter property to the file name. For example, to watch for changes in the file MyDoc.txt, set the Filter property to "MyDoc.txt". You can also watch for changes in a certain type of file. For example, to watch for changes in text files, set the Filter property to "*.txt".
There are several types of changes you can watch for in a directory or file. For example, you can watch for changes in Attributes, the LastWrite date and time, or the Size of files or directories. This is done by setting the NotifyFilter property to one of the NotifyFilters values. For more information on the type of changes you can watch, see NotifyFilters.
You can watch for renaming, deletion, or creation of files or directories. For example, to watch for renaming of text files, set the Filter property to "*.txt" and call the WaitForChanged method with a Renamed specified for its parameter.
See Walkthrough: Create your first VSTO Add-in for Outlook to get started quickly.

Moving saved e-mails from a shared folder to outlook sub-folder

In our company we follow a process where in a team saves e-mails in a shared folder from where people from another team are supposed to pick and start processing. As a improvement idea I was looking for a macro which upon triggering can loop through all the saved e-mails in that folder and can save or bring them in a outlook sub-folder of the processor's inbox of this team.
I have tried and figured out a code from internet which can copy files from one folder to another (please see below) but could not get to modify it to save the .msg files in the outlook subfolder. This is doable manually so was thinking there should be a macro as well which can do it automatically.
Any help will be highly appreciated. Thank you in advance .
Sub Download_sub()
Application.EnableCancelKey = xlDisabled
'downloads the submission mail item into users download folder
Set fobj = CreateObject("Scripting.FileSystemObject") 'create the file system object
fobj.CopyFolder sht_Databases.Range("B21").Value & "\MailFolder" & _
, sht_Databases.Range("B22").Value
Set fobj = Nothing 'release the variable
End Sub
You can use
Application.CreateItemFromTemplate and pass the folder as the second parameter. Note that the message will be created in the unsent state and no sender properties will be copied.
Namespace.OpenSharedItem to open an MSG file, then copy it to a given folder using MailItem.Move().

Replacing a files into multiple folders/subdirectories

Is there a way in command prompt to take files and replace it into another folder and it's sub directories based on it's name?
I have an images in my folder and i have folder have sub directories that have the same name of images, what i want to do i need to replace the image in the sub directories base on the image in my main folder.
I searched for other similar questions and I found a few topics that might interest you.
Batch file to move files based on name w/o creating new folders
Batch Create a Folder Based on Filename, and Move Multiple Related
Files to The Created Folder
If you post the code you have already tried, it may be possible to fix any issues you are having.

how to predict the name of zip folder generated by windows?

I am going to prepare a (windows) server side service which allows users to download their requested files as a Zipped folder. In Microsoft windows(7) If you select all files and folders and send them to a zip folder, a random name will be assigned to the generated zip file which is the name of one files or folders in that collection.
Is there any reason that windows doesn't set a new name say new-zip-file? and how can I predict what the name would be?
The name of the zip is in fact not random,
it relies in the file you choose to click at last.
you can select multiple files but you make right click on one only file in order to zip the group of files, and thats the file name windows chooose.

Create folder in selected folder with OS X Automator

I am trying to batch convert a bunch of raw image files on OS X. I would like to use built-in software since it is possible.
First I would like to
let the user select the input folder containing the raw files;
create a new folder jpgs inside of that folder;
copy the raw files from the user selected folder into jpgs.
This is the workflow I have implemented so far in order to implement the first two steps.
First I let the user select a folder and store it into the variable NEF Folder. The I create a new folder named jpgs in the folder chosen by the user (NEF Folder).
BUT this is what the workflow does after selecting folder AAA on the Desktop:
Why?
Understood.
The action New folder creates a folder and copies its input inside of the newly created folder.
I have the same issue and solved it checking the box "Ignore this action's input".

Resources