Hi,
Basically I have several folders, these folders contain several PDF files
I have created a macro to make Draft MSG files, and attach one PDF file to each MSG file.
This macro works well, so this bit is sorted.
I will post it here below.
///////////////////////////////////////////////
Public Sub NonRecursiveMethod()
Dim fso, oFolder, oSubfolder, oFile, queue As Collection
Set fso = CreateObject("[login to view URL]")
Set queue = New Collection
[login to view URL] [login to view URL]("C:\Test Folder")
Do While [login to view URL] > 0
Set oFolder = queue(1)
[login to view URL] 1
For Each oSubfolder In [login to view URL]
[login to view URL] oSubfolder
Next oSubfolder
x = 1
For Each oFile In [login to view URL]
If InStr(1, [login to view URL], "[login to view URL]", vbTextCompare) > 0 Then GoTo finish:
Set objOutlookApplication = CreateObject("[login to view URL]")
Set objmsg = [login to view URL](olMailItem)
If [login to view URL] = "" Then [login to view URL] = [login to view URL]
If InStr(1, [login to view URL], "[login to view URL]", vbTextCompare) = False Then [login to view URL] [login to view URL]
If [login to view URL] > "" Then
[login to view URL] = "Test MSG File - " & [login to view URL] & " - Part " & x & " of " & [login to view URL]
[login to view URL] ("C:\Test Folder\" & [login to view URL] & ".msg")
End If
x = x + 1
finish:
Next oFile
Loop
End Sub
///////////////////////////////////////////////
However, this is the part that I'm wanting to change.... But here's a short explanation as to why.
We use a third party company to upload emails onto a document storage facility.
We basically copy mail items into a 'shared' mailbox, and their software does the rest.
Normal "Received" emails, are fine... These upload perfectly.
However, my manually created 'DRAFT' emails, do not. I suspect the reason is because they are classed as draft's, and not actual 'received emails' as such.
Their system is programmed to detect the "To:" field... If it has a 'specific' email address in it, then the email will be processed and uploaded.
So, my question is, how can I make my draft emails look like it's been received... Without obviously going through the hassle of sending these emails to myself and re-saving them - There would be a lot of emails, and bandwidth involved, so I'd like to avoid that if possible.
I'd like to... if possible... do it via VBA - by changing my code above - so therefore it would be done in 'one step' not several steps.
I have included the icon of an unread received email... when it's in the mailbox.
And I've also included the icon of one of my created files (draft)... when I drop my own message into the mailbox
This is the DRAFT icon... I need VBA to change my 'draft' email to be in the same state of the first picture - basically to look like a Received email.
I tried a couple of things, such as:
ReceivedTime and SentOn - but I got Read Only errors. I don't know if this is the correct way? Or if there's another flag that I need to mark as TRUE / FALSE etc ??
I also tried changing my code to:
I was thinking, but I don't know if this is possible.... Maybe take a 'received' email - any email... and use that as a "template" ... change the contents of that msg file to match what I want, and then save it.
I don't know if that's possible though.
Please help me.
Thank You