Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Power Pack Visual Studio 2008   PrintForm1

Posted on 2013-06-28
2
Medium Priority
?
778 Views
Last Modified: 2013-07-03
Windows forms  visual studio 2008  I  am using the following code to print a form  
this is working fine but I have to issues

1-I need to insert the Date  on the file name, with this code it does but it only puts the year
example  "2013 Enh A Shift"   I need to be the   Month/Date/Year + File name

2-  I need to hardcode the path to the file to be save right now by default comes on the document folders. I want a Network Share path

 Dim a As Date
        a = Format(Today, "short date")
        Dim pf As New PrintForm
        pf.Form = Me
        pf.Form.BackColor = Color.White
        pf.Form.Controls.Remove(bntprint)
        pf.Form.Controls.Remove(bntcryovac)
        pf.PrinterSettings.DefaultPageSettings.Landscape = True
        pf.PrintAction = Printing.PrintAction.PrintToPrinter
        pf.PrinterSettings.PrinterName = "Adobe PDF"
        pf.DocumentName = a & " " & "ENH A SHIFT"
        pf.Print()
        pf.Form.Controls.Add(bntprint)
        pf.Form.Controls.Add(bntcryovac)




Can you provide me with some samples. thanks
0
Comment
Question by:teogos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
angus_young_acdc earned 1400 total points
ID: 39284660
Your date won't be in the correct format, the slash '/' will be taken as a breakdown of folders.

Instead you could use this:
a = Today.ToString("MM-dd-yyy")

That will give you the month, day and year.   The rest of the code would remain as it is.

I don't use the PowerPacks so can't help with setting the default path for PrintForm.
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 600 total points
ID: 39287206
You are printing to a printer so why is file path involved? Are you printing to PDF? If yes then the save as dialog as shown by pdf print driver so you may not be able to  control that.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question