|
Change the .Verb to "printto", then add the printer name, preferrably in quotes, in the Arguments property:
.Verb = "printto"
.Arguments = """printerName"""
|
|
|
|
|
Thanks Dave
I tried what you suggested but PDF files can't be printed to a remote printer using processstartinfo as printto isn't a verb that is setup by default when installing the Adobe reader.
Found this out by looking at the verbs in processstartinfo e.g.
dim psi as new processstartinfo("c:\quote.pdf")
for each verb as string in psi.verbs
debug.print(verb)
next
and by checking this via windows explorer by going into the Tools -> Options -> File Types tab and looking at the advanced properties.
Back to the drawing board for me on this one at the moment.
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
After reading all of the posts, if you have to print PDF, look into something like GhostPDF.
We have a reporting solution (Business Objects) that has been in place for years. Of late, for WHATEVER reason, reports are now printing with the header and footer information removed.
Since we can save the reports via code in a PDF format, I tried using GhostScript yesterday to print the PDF document to the affected printers. Early results are encouraging.
Tim
|
|
|
|
|
I am working on a data based app. I have everything working to this point. when I go to insert a new record to the table I get a Null reference exception
.
Private Sub StudCount_Compute(ByRef result As String)
' Set result to the desired field value
result = (WallLenght & " " & Guage.ToString & " " & "Ga." & " " & WallHeight.ToString & " " & "Ft.")
End Sub
I'm unsure how to fix this, most likely it's a stupid thing I forgot to do.
Please show Me the error of My way's.
Thanks
Frazzle the name say's it all
|
|
|
|
|
frazzle-me wrote: WallLenght
I don't know about you, but that is not how i spell WallLength.
Not something as simple as that is it?
|
|
|
|
|
Maybe lol typo I'll check
Frazzle the name say's it all
|
|
|
|
|
WallHeight, Gauge, and/or WallLength are probably Nothing and not an actual object instance.
|
|
|
|
|
Sadly I also Misspelled it in the Data base(can You see the "L" on my forehead?)
Fixing all entries he say's while hanging his head low
Frazzle the name say's it all
|
|
|
|
|
Yep. WallHeight, Gauge, and WallLength are not defined or passed in as variables to your subroutine. I'm surprised that it compiles.
Using the debugger, step into the routine and examine the values of those variables. (you can do this by placing your mouse on top of the variable and the tool tip will show you the current value)
|
|
|
|
|
David Mujica wrote: I'm surprised that it compiles.
Option Explicit Off
Public Class Form1
Sub New()
InitializeComponent()
Text = CStr(Value_Of_A_Politicians_Promise)
End Sub
End Class
Bastard Programmer from Hell
|
|
|
|
|
Yep. I know that it could be done by using Option Explicit Off, but my VS environment has it set to default of "Explicit On".
Back in my days of programming Fortran on the VAX, we used to use some compiler directive which effectively forced you to declare all of your variable. I'm old school that way.
|
|
|
|
|
David Mujica wrote: <layer>we used to use some compiler directive which effectively forced you to declare all of your variable. I'm old school that way.
True, that's how things should be. Working without is asking for trouble, giving you a new and empty object when you have a typo in the variable-name.
..and it's not much extra work
Bastard Programmer from Hell
|
|
|
|
|
David Mujica wrote: I'm surprised that it compiles.
With 'Option Explicit Off', you're in for loads of surprises. Unfortunately, VB is often very forgiving.
|
|
|
|
|
Hi All
I am making a string from dataset and then converting to xml.while converting its giving me error unexpected symbol "=" at location
For Each row In dsGetBVItemDetails.Tables(0).Rows
strxmlString += _
"<ItemDetails>" & _
"<Item code=" + dsGetBVItemDetails.Tables
(0).Rows(i)(0).ToString() + ">" & _
"<Description>" +
dsGetBVItemDetails.Tables(0).Rows(i)(1).ToString() + "</Description>" & _
"</Item>" & _
"<ItemQty>" + dsGetBVItemDetails.Tables
(0).Rows(i)(2).ToString() + "</ItemQty>" & _
"<Message>" + dsGetBVItemDetails.Tables
(0).Rows(i)(3).ToString() + "</Message>" & _
"</ItemDetails>"
i = i + 1
Next
It is giving error while converting only when adding attribute "code" in element Item pls suggest
and then converting like this
XFinalXML = XElement.Parse(strxmlString.ToString())
xmlResponse = XElement.Parse(XFinalXML.ToString())
xmlResponseDoc = New XDocument(xmlResponse)
schemaResponse.Add(Constants.TARGETNAMESPACE, AppDomain
.CurrentDomain.BaseDirectory & "Schema\" & Constants.GetBVItemsResponse)
nsResponse = xmlResponseDoc.Root.Name.NamespaceName
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
Are you adding double quote characters around the attribute value that follows "<Item code=" ? You can check this by looking at the generated string in your debugger.
The best things in life are not things.
|
|
|
|
|
yes below is my code
For Each row In dsGetBVItemDetails.Tables(0).Rows
strxmlString += _
"<ItemDetails>" & _
"<Item code=" + dsGetBVItemDetails.Tables
(0).Rows(i)(0).ToString() + ">" & _
"<Description>" +
dsGetBVItemDetails.Tables(0).Rows(i)(1).ToString() + "</Description>" & _
"</Item>" & _
"<ItemQty>" + dsGetBVItemDetails.Tables
(0).Rows(i)(2).ToString() + "</ItemQty>" & _
"<Message>" + dsGetBVItemDetails.Tables
(0).Rows(i)(3).ToString() + "</Message>" & _
"</ItemDetails>"
i = i + 1
Next
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
No, you're not. The resulting string code should be closer to:
<Item code=""" + dsGet... + """>" & _
But, you shouldn't even be doing it this way. You're code is nearly impossible to read and makes it very difficult yo see what's going on. Look at my other reply.
|
|
|
|
|
To add to Dave's comments, you have ignored my suggestion and merely reposted the original code, minus the <pre> tags, so it's almost impossible to read. And it obviously does not include the double quotes; had you used your debugger you would have spotted that fairly quickly.
The best things in life are not things.
|
|
|
|
|
You're missing quotes around the value for code .
Concatentating string together to build an XML document is doing it the hard way and it's less forgiving of typos and invalid characters in the contents.
You might want to look into building it this way:
Dim xml As New XDocument
xml.Declaration = New XDeclaration("1.0", "utf-8", "yes")
Dim rootNode As New XElement("RootNode")
For index = 1 To 3
rootNode.Add(<ItemDetails>
<Item code=<%= index %>>
<Description>Some description text <%= index %></Description>
</Item>
<ItemQty><%= index %></ItemQty>
<Message>Item Message <%= index %></Message>
</ItemDetails>)
Next
xml.Add(rootNode)
Debug.WriteLine(xml.ToString)
Notice that any values are automatically put into quotes when needed. Plus, you get full Intellisense support and syntax checking in Visual Studio 2010.
|
|
|
|
|
Hi Every body...VANAKKAM..( good morning or afternoon or evening in Tamil Langauge)..I want to learn the basiclogic to create my own user control.
Please Guide me..
Selvaraj.G
|
|
|
|
|
In the IDE create a new User Control. Add controls to it and make sure all settings you require are persisted. Apart from that it's the same as creating a form.
You'd be better off learning how to create a controls in a language that hasn't been deprecated and is still supported. Move to .net; C# or VB.net.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
In the name of all that is holy, do not learn VB6.
Nobody uses it.
Switch to VB.Net.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
Hello every1
i want to make a program with vb2010 that can compare a wav file with a realtime recorded voice from microphone and triger something (lets say that a msgbox appear)if the microphone msg is closed to the recorded from a wav.
thnx in advance
speedydc
|
|
|
|
|
You'd have to do something along the lines of a sliding window Fast Fourier Transform or Discreet Fourier Transform on both sets of data. There are a couple of problems with this as you'll have to account for differing sample rates of your WAV file and the samples coming from the mic.
You might also want to look into Hidden Markov Models as they tend to be a bit more forgiving in the sample rate differences.
Good Luck!
|
|
|
|
|
Is it possible to copy a file to a destination that includes a shortcut link in the path? For example, below the \Staged\ is actually Staged.LNK that points to a diff. server. I normally would use the UNC path but am being asked to do this specifically. User has full rights on the directory as well.
<br />
'Statement fails.<br />
System.IO.File.Copy("\\Server\Data Dumps\86355 - Shipment Notice Detail 07.18.2011 11.15.15.108.xml", "C:\Documents and Settings\John Doe\Desktop\Staged\86355 - Shipment Notice Detail 07.18.2011 11.15.15.108.xml")<br />
<br />
'If I add-in Staged.LNK, the statement fails, without .LNK, VB creates an actual folder called Staged and copies the file into that folder vs. using the shortcut path (to a diff. server).<br />
My.Computer.FileSystem.CopyFile("\\Server\Data Dumps\86355 - Shipment Notice Detail 07.18.2011 11.15.15.108.xml", "C:\Documents and Settings\John Doe\Desktop\Staged\86355 - Shipment Notice Detail 07.18.2011 11.15.15.108.xml")<br />
Thanks for any help or comments.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|