|
That means your code doesn't work.
If you'd like to be more specific on what is breaking (ie. Code Snippits of problem area), we might be more specific on what your problem is
|
|
|
|
|
I need some help mapping some printers, i have about 1000 computers with diffrent names for each section. I have about 15 sections of computers. I have about 3 printers in each section. I need to write a VB login script to map these printers to their section. i was tring somehow search for a string in the network computer name and then if it matches i want it to map the printer. heres what i have so far... any help will be greatly appreciated.
objNetwork = WScript.CreateObject("Wscript.Network")
Network = CreateObject("Wscript.Network")
compname = network.computername
Dim name As String
'stops it from mapping the printer twice
For Each strPrinter In objNetwork.EnumPrinterConnections
objNetwork.RemovePrinterConnection(strPrinter, True, True)
Next
name = kgwfd
if name.search(kgw) = true then map
If network.ComputerName = "KGWLIB-12.mayplace.org" Then
' "KGWLIB-12.myplace.org"
Network.AddWindowsPrinterConnection("\\keigbdc\hp4000ke")
Network.SetDefaultPrinter("\\keigbdc\hp4000ke")
' "KGWLIB-13.myplace.org"
Network.AddWindowsPrinterConnection("\\keigbdc\hp4000ke")
Network.SetDefaultPrinter("\\keigbdc\hp4000ke")
End If
end
End Sub
End Class
|
|
|
|
|
Help with what? You haven't said what anything about the problem your having.
I take it these are Windows Servers hosting the printers?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok, I know what you are thinking. Why was this posted on the VB.Net forum? Well, let me explain.
I Have a DHTML text editor that I currently import Microsoft Word documents into via IE. The only problem is only text comes across currently. I came across info on MSDN that said images can be saved out of Word 2003 as bmp files. So far I can open the document, get a handle on each image, and copy them to the clipboard, but for some odd reason, probably my fault , I can't seem to save them to the hard drive.
I've included the code below, perhaps you can assist, especially if you know MS VB.NET and VBScript better than I, which wouldn't be difficult to do. Basically I get the image copied to the clipboard fine but then I don't seem to be saving anything out. Nothing fails, it just doesn't save. Any help would be greatly appreciated.
Sub ImportWordDoc()
On Error Resume Next
Set wApp = CreateObject("Word.Application")
wApp.Activate
wApp.WindowState=0
call wApp.Resize(400, 400)
Set wDoc = wApp.Documents.Open(document.all.FileToOpen.value)
wApp.Visible = true
For index = 1 To wDoc.InlineShapes.Count
inlineShape = ""
Set inlineShape = wApp.ActiveDocument.InlineShapes(index)
inlineShape.Select()
wApp.Selection.CopyAsPicture()
data = ""
Set data = Clipboard.GetDataObject()
If data.GetDataPresent( GetType( System.Drawing.Bitmap )) Then
bmp = ""
bmp = CType(data.GetData(GetType(System.Drawing.Image)), Bitmap)
bmp.Save( "C:\mybitmap" + cstr(index) + ".bmp" )
End If
Next
Call wDoc.Close(True)
call wApp.Quit(True)
End Sub
Any help or suggestions would be greatly appreciated.
Tim
|
|
|
|
|
ironclads wrote:
If data.GetDataPresent( GetType( System.Drawing.Bitmap )) Then
bmp = ""
bmp = CType(data.GetData(GetType(System.Drawing.Image)), Bitmap)
bmp.Save( "C:\mybitmap" + cstr(index) + ".bmp" )
End If
Does your code even get to the "bmp = CType(data.GetData(..." line? A possibility would be that you're not actually seeing a Bitmap on the clipboard.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yes, I've done alert prompts after the bmp save and they come up for each image, so I know its getting into the if statement. Any other help or suggestions for me?
Thanks.
<<<<TIM>>>>
|
|
|
|
|
With a PictureBox; when it has an image loaded, I would like to be able to open the image in the default image viewer (or select an image viewer) when the image is ‘clicked’.
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click<br />
<br />
[Open the current Image in the default image viewer...]<br />
<br />
End Sub
Does anybody know how this can be done?
Thanks
Brad
|
|
|
|
|
If you wanted to launch the default application, you would just launch the graphics image file ("C:\SomeDir\MyGraphics.JPG") using the Process class' .Start() method. Be sure to specify that you want a Shell launch. You can get more information on the Process class here[^] on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Dave.
I figured this out at just about the same time you posted...
Here is what I did:
Dim fileToOpen As String = fpath & selectedItem<br />
System.Diagnostics.Process.Start(fileToOpen)
I had the answer "right under my nose" the whole time in another part of my application.
Brad
|
|
|
|
|
You might want to change your code a little bit so you can accomodate how paths are handled in different situations, like the root of the drive...
Dim fileToOpen As String = Path.Combine(fpath, selectedItem)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
who's know how to add value into combo box import from sql DB but
combo1.item={"value1")
thank you
|
|
|
|
|
You can add items to the combobox by calling Combobox.Items.Add("Blah")
You can also set the selecteditem by calling ComboBox.SelectedItem = ComboBox.Items(0)
Hope this helps
WM.
What about weapons of mass-construction?
|
|
|
|
|
HI
CAN U TELL ME THE WAY TO USE DRAFT FONT IN VB 6.0 DATA REPORT. AND PLEASE GIVE ME THE CODE FOR THAT IF ANY
THANKS A LOT
|
|
|
|
|
i am trying to call a secure SSL webservice from vb6 using soap as i call the webserice method the following error is raised .
1) "SoapMapper:Restoring data into SoapMapper USR_RECORDING failed HRESULT=0x80070057: The parameter is incorrect.
-Client:Unspecified client error. HRESULT=0x80070057: The parameter is incorrect."
2) Question.
How can i digtiaal sign the XML using x509certificates in vb6 code.
How can i get rid of this error using SOAP
Hoping +ve response...
|
|
|
|
|
any good link for crystal report with .NEt forum ?
any help 'll be appreciable
|
|
|
|
|
How to calculate(for eg all Saturdays and sundays with date) to a specified year in a combobox?
In other words,how to get all saturdays and sundays to the year chosen in a combo box?
Raji
|
|
|
|
|
You're the second person to post this question in 20 minutes. Now why does this sound like homework?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It does have that crispy look too
WM.
What about weapons of mass-construction?
|
|
|
|
|
hi
i m in deep trouble. Is there anybody who can guide me , how to use excel as a backend database for my project.
Mian Rashed Inam Khattak
|
|
|
|
|
I don't know if I can help at all, but as far as I know using Excel as a database isn't possible, not in the truest sense. You can write to and from Excel spreadsheets, the data is access by accessing the file, not by using it as a database backend. I've never seen a usage of connecting to data in excel like a database would. You'll need to use Access or even Sequel Server for something like that.
I have some code for writing to Excel spreadsheets. It is written in LotusScript but if you know VBScript or VB you shouldn't have any problems following it. You can also look on http://msdn.microsoft.com/ for help as well on the capabilities of Excel.
http://skylab.ironclads.com/codes.nsf
Good Luck!
<<<<TIM>>>>
|
|
|
|
|
thanks for the help.
i know exactly what you have said, but the problem is that my datasources are excel sheets. and one again thanks for the help.
Mian Rashed Inam Khattak
|
|
|
|
|
my actual problem was how to connect excel worksheet(existing) to vb.net. i mean what driver and else.....
Mian Rashed Inam Khattak
|
|
|
|
|
How to extract Day(s),Month(s) from a Year using VB.NET program?
|
|
|
|
|
Could you be more specific?
<italic>Work hard, Work effectively.
|
|
|
|