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

Postby kagsw1 » Tue Feb 16, 2010 10:55 pm

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



Softland
Posts: 1491
Joined: Thu May 23, 2013 7:19 am

Postby Softland » Fri Feb 19, 2010 1:21 pm

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?



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

Postby kagsw1 » Fri Feb 19, 2010 10:27 pm

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?



Softland
Posts: 1491
Joined: Thu May 23, 2013 7:19 am

Postby Softland » Mon Feb 22, 2010 1:58 pm

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.



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

Postby kagsw1 » Mon Feb 22, 2010 8:05 pm

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



Softland
Posts: 1491
Joined: Thu May 23, 2013 7:19 am

Postby Softland » Thu Feb 25, 2010 2:26 pm

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.



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

Postby kagsw1 » Thu Feb 25, 2010 8:07 pm

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

Postby lensen » Sun Mar 07, 2010 2:14 pm

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

Postby kagsw1 » Tue Mar 09, 2010 12:54 am

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


Ken



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

Postby lensen » Tue Mar 16, 2010 12:18 am

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




Return to “General”