default print file name

You can ask general questions, share opinions or advices about doPDF.
kagsw1
Posts: 6
Joined: Tue Feb 16, 2010 3:43 pm

Post by kagsw1 »

Just installed, great product.

When I print from MS word, the default file name is the document name.

When I print from my VB application, the default file name is "Microsoft Visual Basic".

Is there a way to set the default file name to something more useful from a VB6 application?
Ken Gilbert


Claudiu (Softland)
Posts: 1565
Joined: Thu May 23, 2013 7:19 am

Post by Claudiu (Softland) »

Hi Ken, that name is suggested because that's how the application is recognized, because you're basically printing from VB. What name do you think it should suggest by default when printing from VB, you mean it should recommend as with Word the name of the VB file?

Follow us to stay updated:

kagsw1
Posts: 6
Joined: Tue Feb 16, 2010 3:43 pm

Post by kagsw1 »

I was just trying to understand what logic DoPDF uses to select the default file name. Clearly, MS Word somehow exposes its file name. I was wondering if there was any way for my VB application to expose the file name I would like used as the default?


Claudiu (Softland)
Posts: 1565
Joined: Thu May 23, 2013 7:19 am

Post by Claudiu (Softland) »

we'll look into that, and if it's possible we'll use the name of the saved VB file too just as in word.

Follow us to stay updated:

kagsw1
Posts: 6
Joined: Tue Feb 16, 2010 3:43 pm

Post by kagsw1 »

Thanks Softland. Let me know (with a post) if there is something I need to do to enable you to see the file I have open before I print.
Ken


Claudiu (Softland)
Posts: 1565
Joined: Thu May 23, 2013 7:19 am

Post by Claudiu (Softland) »

Hi Ken, unfortunately we cannot do anything about printing from VB. The problem is that this is how VB sends the filename for printing, and we can only work with the filename it sends.
So if you have programmed a VB application that prints, maybe there's a way you can programmatically send the correct title for printing.

Follow us to stay updated:

kagsw1
Posts: 6
Joined: Tue Feb 16, 2010 3:43 pm

Post by kagsw1 »

Thanks again Softland. I looked to see if there was a general property I could set but didn't find anything meaningful. Can you tell me what Windows system call you make to retrieve the file name or the name of the parameter passed that contains the file name? This might help me figure out how to set the file name before I invoke the printing.
Ken


lensen
Posts: 4
Joined: Wed Mar 03, 2010 4:35 pm

Post by lensen »

You can try this code, paste it as a printer path
Dim strDesktop As String

Const ssfDESKTOP = 0

strDesktop = CreateObject("Shell.Application").NameSpace(ssfDESKTOP).Self.Path

MsgBox strDesktop
Clipboard.Clear

Clipboard.SetText strDesktop & "\Weeknr. " & txtWeekNr.Text


kagsw1
Posts: 6
Joined: Tue Feb 16, 2010 3:43 pm

Post by kagsw1 »

Sorry Lensen, but I don't understand this post.
Ken


lensen
Posts: 4
Joined: Wed Mar 03, 2010 4:35 pm

Post by lensen »

Place the code in the vb code of your VB program before you print.

Then, in the window that the doPDF pdf file to come, click the right mouse button to paste your own path and file name into it.

In this case the file is placed on the desktop.
Kars


Post Reply