Results 1 to 2 of 2

Thread: Ms Outlook Forms Printing Help

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2003
    Location
    New York City
    Posts
    2

    Talking Ms Outlook Forms Printing Help

    I have been working with Outlook forms for a good 4 months now, among other projects here at work. I have a CUSTOM FORM with a CUSTOM BUTTON problem.

    I wrote a VBSCript Code on a POST-item object that allows the printing of the information in the Outlook Form via a Word Document Template.

    Now...I just had to redesign the form in a MAIL-item object. Problem is...the Custom PRINT FUNCTION does not work!!!

    I made sure that all the items in the Outlook form are LOCAL to the form so I could call-on each object. Here's a wierd thing (i found it wierd)...once I open the custom form...I have to go click TOOLS>>FORMS>>DESIGN THIS FORM...and then I Hit TOOLS>>RUN THIS FORM (which then instantiates the form in RUn Time)..and when I click on my custom PRint Button...it PRINTS (using the Word Document template).

    I NEED HELP. What's happening here...and what do I need to do to make it work properly???

    THANK YOU


    I posted this in the ASP section...so I tried posting it here, coz maybe i posted this in the wrong section after all.
    Attached Files Attached Files

  2. #2
    Addicted Member
    Join Date
    Jun 2002
    Location
    Brugge, Belgium
    Posts
    208
    Hello there,

    could it be that you don't open Word and make it visible ?

    Here's a sample of an xl file I attach to an Outlook form.

    You should be able to do the same with Word. Have you tried recording a print action. The code generated is almost cut and paste ready.

    Code:
    Dim oXLApp
    Dim oXLSheet
    
    Set xl = CreateObject("Excel.application")
    If xl Is Nothing Then
          MsgBox "Couldn't start Excel."
       Else
        xl.Visible = True
        Set xlbook = xl.Workbooks.Add
        Set xlsheet = xlbook.ActiveSheet   
    	With xlsheet
            .Cells(1, 1) = "Type of demand"
            .Cells(1, 2) = "Material"
            .Cells(1, 3) = "Supplier Reference"
            .Cells(1, 4) = "Description"
            .Cells(1, 5) = "Current Usage"
            .Cells(1, 6) = "New Usage"
            .Cells(1, 7) = "Delivery date"
            .Cells(1, 8) = "Remarks"
    	for x=0 to count
                    if MaterialListArray(x,0) <> "" then
    		for y=0 to 7
    		.Cells(x+3,y+1)=MaterialListArray(x,y)
    		next
    	end if    
    	next
    	end with
    	 xlbook.ActiveSheet.SaveAs ("c:\temp\test.xls")
    	
     end if
    Set xl = Nothing
    Set xlbook = Nothing
    item.attachments.add "c:\temp\test.xls"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width