Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / March 2008

Tip: Looking for answers? Try searching our database.

Printing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pierre Scerri - 27 Feb 2008 21:58 GMT
How can i print the text contained in a label in a form?

Thanks
Sue Mosher [MVP-Outlook] - 27 Feb 2008 22:41 GMT
See http://www.outlookcode.com/article.aspx?id=24 for various solutions to the limitation that Outlook forms don't support WYSIWYG printing. The Word template technique is the most flexible and highly recommended.

Signature

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

> How can i print the text contained in a label in a form?
>
> Thanks
Pierre Scerri - 28 Feb 2008 13:43 GMT
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.

> See http://www.outlookcode.com/article.aspx?id=24 for various solutions to the limitation that Outlook forms don't support WYSIWYG printing. The Word template technique is the most flexible and highly recommended.
>
> > How can i print the text contained in a label in a form?
> >
> > Thanks
Sue Mosher [MVP-Outlook] - 28 Feb 2008 14:00 GMT
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/microsoft.public.scripting.vbscript/browse_thread
/thread/660de13e689486b4/888be5a1c85015f3
):

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

Signature

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

> 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.
[quoted text clipped - 10 lines]
>> >
>> > Thanks
Pierre Scerri - 28 Feb 2008 15:09 GMT
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.

> Add-in? Word can be automated from VBScript behind a custom form just fine, even if you can't distribute a Word template.
>
[quoted text clipped - 22 lines]
> >> >
> >> > Thanks
Pierre Scerri - 07 Mar 2008 08:47 GMT
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

> That's exactly what i was looking for.  I'll give it a try.
>
[quoted text clipped - 28 lines]
> > >> >
> > >> > Thanks
Sue Mosher [MVP-Outlook] - 07 Mar 2008 13:24 GMT
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.

Signature

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

> After your suggestions i started trying things out and came up with this:
>
[quoted text clipped - 34 lines]
>> > >> >
>> > >> > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.