|
I have the below statement that will bring up the the windows print manager when a user clicks the button on the web page.
Print button statement---
Print this pagenclick=" window.print(); return false"
How would I alter this statement to have the windows "save page as" window appear to save the web page as a html document?
If I change the statement to the below it will not work.-----
Save this pagenclick=" save(); return false"
Thanks for the help!!
|
|
|
|
|
Try a different forum, for starters.
|
|
|
|
|
Was this not a visual basic/ vb.net question since it is a vb statement?
|
|
|
|
|
Your examples are JavaScript not VB. And as you what something to happen Client side, you should be asking how to do this in JavaScript
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Hi,
I have an vb.net application that opens a word document, fills in some data, prints it out (on a printer that is not set as standard printer)
Because .NET sets the other printer as standard, i have another line that puts the original printer back as standard printer
When this program was used, it is impossible to print something from excel 2003... Something in my program does something to excel apparently
This is the code i use (short version)
Imports wrd = Microsoft.Office.Interop
Module Module1
Sub Main()
Dim moapp As wrd.Word.Application
Dim odoc As wrd.Word.Document
moapp = New wrd.Word.ApplicationClass().Application
moapp.Visible = False
odoc = moapp.Documents.Add("C:\Documents and Settings\9312323\Desktop\excelbug.doc")
moapp.ActivePrinter = "\\N318416\PRINT068 NRG SP 4100N"
'With moapp.ActiveDocument.PageSetup
' .FirstPageTray = 258
' .OtherPagesTray = 258
'End With
'moapp.Application.PrintOut(FileName:="", Range:=wrd.Word.WdPrintOutRange.wdPrintAllDocument, Item:= _
' wrd.Word.WdPrintOutItem.wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wrd.Word.WdPrintOutPages.wdPrintAllPages, _
' ManualDuplexPrint:=False, Collate:=True, Background:=True, PrintToFile:= _
' False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
' PrintZoomPaperHeight:=0)
moapp.ActivePrinter = "\\N318416\PRINT019 NRG P7527n"
odoc.Close(False)
moapp.Quit()
End Sub
End Module
Has anyone got an idea how to work around this problem? My application works just fine.. but Excel 2003 can't print anymore
if someone won't believe this, just copy the code in a new project, add reference to microsoft word 11.0 object library, and run it , then try to print something from excel (without changing printer first)
grtz
edit: if you should try the code, i would recommend on changing the printernames
|
|
|
|
|
If this is the actual code you are running, why is the .PrintOut statement commented out?
|
|
|
|
|
tnx for your reply
this is not the actual code from the program, but it is however the actual code from a testprogram i wrote to simulate the problem.
I commented out those lines so i did not have to print out a document every time i wanted to simulate the problem
so running the code above will result in excel not being able to print...
|
|
|
|
|
Editing this question for further clarification.
I have a datagridview on a win form app. The selection mode is set to full row, that way when the user selects a different row - the entire row is selected. There is additional code (per design) so that when the user presses the left or right buttons, the previous or next row is selected.
When using the left or right buttons, the current cell selection box is still visible (the white outline around the current cell). Is there any way to hide that selected cell outline?
Looks annoying when pressing the left/right buttons to go up or down and seeing the current cell shifting.
Any ideas?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
modified on Thursday, August 21, 2008 2:17 PM
|
|
|
|
|
Can anyone throw me a bone here? ruff, ruff.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
How about changing the current cell reference to a corresponding cell on the new selected row? The selection rectangle should also move then?
|
|
|
|
|
Just figured it out. Little embarrassing...I was changing the row/cell, but then not toggling the handled property (so the grid view was still moving the cell since I was using the right button).
All is well now. Sigh. LOL.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
I'm looking to create a VBS that will query the RSoP and return the security settings of the system e.g. account policys, local policys, event log etc.
So far with a bit of research i have this, however this seems to just display password details - min password age, lockout duration, min max length etc.
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\rsop\computer")
Set colItems = objWMIService.ExecQuery _
("Select * from RSOP_SecuritySettings")
For Each objItem in colItems
Wscript.Echo "Key Name: " & objItem.KeyName
Wscript.Echo "Precedence: " & objItem.Precedence
Wscript.Echo "Setting: " & objItem.Setting
Wscript.Echo
Next
Can anyone help me further or point me in some directions.
Cheers
Gary
|
|
|
|
|
Hi
I'm converting this C# code to VB.net. I'm using online conveters but the converted code give me errors please help
private void IveGotEventDataToReport(String str)
{
SystemMessageArgs args = new SystemMessageArgs(str);
lock (this)
{
Delegate[] delegates = m_EventChannelDataReceived.GetInvocationList();
foreach (Delegate aDelegate in delegates)
{
EventChannelMessage sink = (EventChannelMessage)aDelegate;
sink.BeginInvoke(this, args, null, null);
}
}
}
Converted VB Code
Private Sub IveGotEventDataToReport(ByVal str As String)
Dim args As New SystemMessageArgs(str)
SyncLock Me
Dim delegates As [Delegate]() = m_EventChannelDataReceived.GetInvocationList() 'Error
For Each aDelegate As [Delegate] In delegates
Dim sink As EventChannelMessage = DirectCast(aDelegate, EventChannelMessage)
sink.BeginInvoke(Me, args, Nothing, Nothing)
Next
End SyncLock
End Sub
I get the error on line number 4 , the error message is
Error 2 'Private Event m_EventChannelDataReceived(sender As Object, se As SystemMessageArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.
Please help with this Regard
Thanks in advance
|
|
|
|
|
You were told how to fix this earlier today, and you gave him a 1 vote and asked again. If you're not smart enough to follow simple instructions, perhaps you should learn Logo instead or something.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Christian Graus wrote: should learn Logo instead
I was introduced to Logo in 1982 when our school got a brand spanking new Apple ][e
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
See Graus' response.
Blog link to be reinstated at a later date.
|
|
|
|
|
declaring a new IP address
Dim add As IPAddress(New Address As Long)
the long value of IP Address? how to find that?
it says like a value 0x3l3443 in big endian format...
how to convert IP to big endian or Long?
|
|
|
|
|
Just use shift operators to move your 4 bytes into the right locations of your single digit.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
didn't get that honestly!
say i ve an IP 123.212.4.3
hot to find its long or big endian form?
|
|
|
|
|
In C#, you'd do do 123 << 8 to move the byte across by 8 bits. I don't know how to do that in VB, but that's the general idea. You could just multiple by 2 to the power of 8, 2 to the power of 16 and 2 to the power of 24, if you can't find the shift operator.
Oops - this is the C# forum.
123 << 24 + 212 << 16 + 4 << 8 + 3 would move them so they were in order, left to right. I'm sure that's not big endian, so get the order of digits right and that should work.
http://www.codeproject.com/KB/cs/leftrightshift.aspx[^] explains how it all works. There's at least one other article that has a helper class you may want to check out.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Are the IPAddress.NetworkToHostOrder and IPAddress.HostToNetworkOrder methods of any use to you?
Alan.
|
|
|
|
|
i am currently using vs 2005 to send mass sms, such that the request goes to SQL server 2005 and then to ozeki sms server.
it was working perfectly fine and it just suddenly stop working.
these are (part of) my codes:
Protected Sub btnSend_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSend.Click
Call SelectAllUsers()
End Sub
Protected Sub SelectAllUsers() 'Method to select all users data to send
Dim connStr As String = ConfigurationManager.ConnectionStrings("SMSConnectionString2").ConnectionString
Dim conn As New SqlConnection(connStr)
conn.Open()
Dim ds As DataSet
Dim mySQL As String = "Select phone_number from users where category = 'A'"
Dim da As SqlDataAdapter
da = New SqlDataAdapter(mySQL, conn)
ds = New DataSet()
da.Fill(ds, "phone_number")
Dim tblNumbers As DataTable
tblNumbers = ds.Tables("phone_number")
Dim drNum As DataRow
For Each drNum In tblNumbers.Rows
InsertSMSRecord(drNum("phone_number").ToString)
Next
Me.textboxError.Visible = True
Me.textboxError.Text = "Message has been sent to all users in Category A."
...
Protected Sub InsertSMSRecord(ByVal recepientNumber As String) 'Inserting Record to Database, To trigger
Dim connStr As String = ConfigurationManager.ConnectionStrings("SMSConnectionString2").ConnectionString
Dim conn As New SqlConnection(connStr)
Dim mySQL As String = "Insert Into ozekimessageout (receiver,msg,timetosend,status,sender,category) values (@receiver,@msg,@timetosend,@status,@sender,@category)"
Dim SqlInsert As SqlCommand = New SqlCommand(mySQL, conn)
SqlInsert.Parameters.AddWithValue("@receiver", recepientNumber)
SqlInsert.Parameters.AddWithValue("@msg", Me.txtMsg.Text)
SqlInsert.Parameters.AddWithValue("@timetosend", Me.showTime.Text)
SqlInsert.Parameters.AddWithValue("@status", "send")
SqlInsert.Parameters.AddWithValue("@sender", Me.lblShowUser.Text)
SqlInsert.Parameters.AddWithValue("@category", Me.dd_category.SelectedValue)
conn.Open()
SqlInsert.ExecuteNonQuery()
conn.Close()
End Sub
nth get sent to the database and when i manually add something into the database, my server doesn't respond as well.
help
|
|
|
|
|
so, which line is failing ?
peanutong wrote: when i manually add something into the database, my server doesn't respond as well
Sounds like the server is dead, no ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
my server is a sms server. now it can send single smses. but cant send multiple smses at one go, as in mass send? can u see any problem with my sql statement?
as my server is able to send single sms, so its not dead. i just don't know why i was able to mass send smses a few days ago. today it just suddenly died.
modified on Thursday, August 21, 2008 6:49 AM
|
|
|
|
|
No, it's pretty vanilla SQL. I guess the issue is the limitations of the server.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|