Printing

  • Thread starter Thread starter Pierre Scerri
  • Start date Start date
Thanks for the info. But this is too complicated a way to do it. It would
involve other users having to install the add-in.

All i need is a simple text print. It does not have to show the dialog box
just the text in plain ASCII. The text contains more than one line. Is
there any way that i can send it straight to a printer?

Thanks.
 
Add-in? Word can be automated from VBScript behind a custom form just fine, even if you can't distribute a Word template.

An alternative would be to build a new Outlook item, include the desired content in the Body property, then call that item's PrintOut method. That can all be done within VBScript or VBA.

Still another would be to create a text file using FileSystemObject methods and then print that file using code like this ( from http://groups.google.com/group/micr...read/thread/660de13e689486b4/888be5a1c85015f3):

strFile = "test.txt"
strFolder = "C:\temp"
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(strFolder)
objFolder.ParseName(strFile).InvokeVerb("print")

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
That's exactly what i was looking for. I'll give it a try.

Thanks

PS Sorry about the add-in. Must have misread something.
 
After your suggestions i started trying things out and came up with this:

Set myOlApp = CreateObject("Outlook.Application")
Set myitem = myOlApp.CreateItem(olNoteItem)
myitem.Body = LblView.Caption
myitem.PrintOut

That works well except that i need to change the font size to simulate
Tools|Options|Note Options...

Can i do this through VBA?

Thanks
 
No, individual note items do not have any formatting of their own. The font is controlled by the Tools | Options setting, which is held in the Windows registry, not controlled by the Outlook object model.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
Back
Top