Simple Print Macros

  • Thread starter Thread starter Hank Youngerman
  • Start date Start date
H

Hank Youngerman

I would like to write a simple macro that would open and print all the
emails in a folder. How do I write and execute it? Seems like it
should be simple.

I think it will be something like:

Select folder
For each mailitem in
mailitem.open
mailitem.print
next mailitem

But I don't know the exact syntax.

Thanks in advance.
 
Hank Youngerman said:
I would like to write a simple macro that would open and print all the
emails in a folder. How do I write and execute it? Seems like it
should be simple.

I think it will be something like:

Select folder
For each mailitem in
mailitem.open
mailitem.print
next mailitem

But I don't know the exact syntax.

Thanks in advance.
 
If you make a reference to the MS Outlook object library, you will then get
extended help that will address how to drive outlook from Excel

Martin
 
Sub GetEmails()
Const oFolderInbox As Long = 6
Dim oOL As Object
Dim oNameSpace As Object 'Outlook.NameSpace
Dim oInbox As Object 'Outlook.MAPIFolder
Dim oItem As Object

Set oOL = CreateObject("Outlook.Application")

Set oNameSpace = oOL.GetNamespace("MAPI")

Set oInbox = oNameSpace.GetDefaultFolder(oFolderInbox)

'Make Outlook visible
oInbox.Display

For Each oItem In oInbox.items
oItem.PrintOut
Next oItem

End Sub


--
HTH

Bob Phillips

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top