|
|
I am using the classes and methods from the Msxml2.DOMDocument.4.0 namespace to dynamically create an XML file using VBScript. (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/htm/xml_mth_sz_3jol.asp). I was able to successfully create the XML and load it into memory for parsing. However, for some reason, I am not able to use the SelectSingleNode() method of the IXMLDOMNode object. The error I get is: "Object doesnt support this property or method. Error code: 800A01B6".
Any ideas?
|
|
|
|
|
Does anyone know if you can interact with an embedded OLE object in PowerPoint slideshow mode? I have an OLE object which draws a 3D representation of a plane and would like to manipulate it using mouse events. I can get to the COM interface of my object, but it seems impossible to refresh the content of the slide with the new picture.
Thanks to all,
pnyr
|
|
|
|
|
Ok, first and formost, thanks everybody that helped me with my last 2 questions. I THINK I have that problem all worked out. With less than 2 weeks until my semester project gets done, I'm starting to feel the heat and I'm forgetting some of the very basic of basics. I have a label that I want to change the value of from what I made it at design time to something else during run time. So obviously I need a
label.caption = literal string
statement. My question is... HOW IN GOD'S NAME do you put quotations around a word inside your literal string? I thought there was a way to trap out a character by putting something in front of it, but I can't remember to save my soul...I've tried square brackets, dollar sign, single quote, back quote...everything. Little help?
--------------------
Tim Perry
"Remember, comments are there to make people laugh, not to help them fix your code later...because you're code is always perfect"
|
|
|
|
|
Hi Tim. In C# you would escape the double quote with a backslash in front of it. In VB.NET you can always use Chr(34) :
dim kQUOTE = Chr(34)
label.caption = "My string with a " & kQUOTE & "quoted" & kQUOTE & " word" I think the Microsoft.VisualBasic namespace has a Quote constant you can use too.
|
|
|
|
|
The chr function idea worked, thanks tons!!! I honestly never would have thought of that one
--------------------
Tim Perry
"Remember, comments are there to make people laugh, not to help them fix your code later...because you're code is always perfect"
|
|
|
|
|
You could also just use double-quotes. Where there are two quotes in a row, a single quote marks becomes part of your litereal string:
Dim strLiteral As String = "This is a ""quoted"" string."
lblSomeLabel.Text = strLiteral
will output a label that looks like this:
This is a "quoted" string.
RageInTheMachine9532
|
|
|
|
|
You know, Dave, it's amazing to me the things I have forgotten...
Now I remember two-quotes-in-a-row! (no really, I used to code in vb a lot... honest!)
|
|
|
|
|
I know the feeling! There's so much I've forgotten about Intel X86 Assembler... like everything...
RageInTheMachine9532
|
|
|
|
|
I tried to implement the code in the article: http://www.codeproject.com/vb/net/data_accessor_class.asp and get the following errors when trying to compile using command line. Although the article imports sqlClient, I am using OleDb because of Access database. But the problem occurs even for System.Data.
I have installed .net framework and .net SDK. I do not have Visual Studio .net installed. Am I missing to install something else?
Error
C:\test.vb(1) : error BC30466: Namespace or type 'Data' for the Imports 'System.Data' cannot be found.
Code snippet looks something line this -
Imports System
Imports System.Data
Imports System.Data.OleDb
Public class clsTest
Public Sub New()
End Sub
Public Sub GetSomeData(ByVal sender As System.Object, ByVal e As System.EventArgs)
..............
...............
|
|
|
|
|
Hi there. You need to include a reference to the System.Data assembly in your command line for the compiler using the /reference or /r switch. Something like:
vbc /r:System.Data.dll /t:library /out:test.dll test.vb
|
|
|
|
|
Does anyone know how to invoke PositionChanged event programatically on BindingManagerBase object.
When BindingManagerBase is set, the position is 0 (if row count is > 0) and this event won't fire. It will be fired if I change position programatically (BM.Position = 4), but I need that event immidiatly after it is set to do something with row on position 0.
Thanks in advance,
Vasil
|
|
|
|
|
Hello everyone,
I have a little problem with VBScript.
I've written a script that copy the selected text of the current Internet Explorer Window when the user click on the button and it works well.
But in some computers with different security rights, it doesn't.
Here is my code :
' Create the Shell object
Set Wsh = WScript.CreateObject("WScript.Shell")
Wsh.SendKeys "^{c}" ' send Ctrl+C, copy to clipboard
Set IE = WScript.CreateObject("InternetExplorer.Application")
Dim Num
with IE
.navigate "about:blank"
Num = .document.parentwindow.clipboardData.getData ("text")
.quit
end with
I guess that a user needs to have special rights to create a shell in a script and execute a command...
So How can I get the selected without using a shell ?
A way could be to execute copy from the Window where the button was clicked... But How do I get the object of the "parent" window of the script ?
Is there some kind of WScript.Parent attribute ?
Thanks,
Jerome
|
|
|
|
|
Hi guys,
How can i create my own description of the method i defined in my class such that when i call this method a TOOLTIP will come out exposing the Description i wrote for that particular method. Just like the members of any class in any assembly. When you press period (.) the members will come out and a tooltip will be displayed categorically showing the signature, return type and purpose for this method.
Tnx a lot!
|
|
|
|
|
I already told you, you need a third party tool to do this in VB.NET. The VB.NET compiler currently does not support generating the XML file required. VBCommentor on GotDotNet.com is a great place to start if you want to do this! Or, you could rewrite your classes in C#...
VBCommentor on GotDotNet.com[^]
RageInTheMachine9532
|
|
|
|
|
Ah ok sorry i didn't noticed my previous post has replies already. Tnx a lot.
|
|
|
|
|
I have a file stream reader that looks for certain text in a text file and prints that to a file. The problem is it is printing the following line i am looking for instead of the line i want.
here is the code:
Dim sr As New StreamReader("c:\test.txt")
Dim sw As New StreamWriter("c:\did it work.txt")
Do Until sr.Peek() = -1
If sr.ReadLine.StartsWith("LIN") Then
sw.WriteLine(sr.ReadLine.ToString)
End If
Loop
sr.Close()
sw.Close()
Any help very much appreciated
|
|
|
|
|
Anonymous wrote:
Dim sr As New StreamReader("c:\test.txt")
Dim sw As New StreamWriter("c:\did it work.txt")
Do Until sr.Peek() = -1
If sr.ReadLine.StartsWith("LIN") Then
sw.WriteLine(sr.ReadLine.ToString)
End If
Loop
sr.Close()
sw.Close()
The problem is you told the StreamReader (sr) to read the next line when you went to write the line you just read. The code should read like this:
Dim sr As New StreamReader("c:\test.txt")
Dim sw As New StreamWriter("c:\did it work.txt")
Dim strLine As String
Do Until sr.Peek() = -1
strLine = sr.ReadLine()
If strLine.StartsWith("LIN") Then
sw.WriteLine(strLine)
End If
Loop
sr.Close()
sw.Close()
Also, calling .ToString on a String variable is unnecessary. ReadLine always returns a String...
RageInTheMachine9532
|
|
|
|
|
Is there any way(probably api) to know which words are occured most frequently in MSWord Documnet. I am developing add-in and want to get
the list of and number of occurence word before you save the document?
Thanks
Shinya
|
|
|
|
|
You'll have to write the code to build that table since Word doesn't track that kind of information. Word can probably return individual "word" objects and you can use those to build a key->value dictionary. If the word isn't in the dictionary, add it set it's value to one. If it is in the dictionary, increment it's value. When you're done counting words, convert the dictionary to a 2D array of values and sort it on the counts. You'll then have the most often used word at the top.
RageInTheMachine9532
|
|
|
|
|
I want to be able to create an html file through a vb program that I have writtin what is the eaysist way to do this??
|
|
|
|
|
You didn't supply enough information about what you want to do like what does the VB program, that you've written, DO? And what are you doing with the HTML file?
But since you asked...open a file for Output with the Open statement and use Print #<filenumber> statements to output the text that will make up the HTML file, then use Close to close the file...
RageInTheMachine9532
|
|
|
|
|
Well i am makeing a grading program for a teacher and i need to know how do output the grades and students id as an html so that he may post them on his web page i thought about what was stated earlyer but when you output a file i don't know how to change the file extenions so that it is an .html insted of a .dat or .txt
|
|
|
|
|
What do you mean by "changing the file extension"? Since your outputting the file from VB, you can make the file extension anything you want... Are you doing this in Excel or something else?
Well, first you have to have some code that you having problems with. Discussing design over a forum is notoriously difficult...
But, I'm assuming your doing this as a class project? I'm not going to write the code for you, and neither will anyone else here.
If you know HTML, you could start by putting together an HTML page with some phony data for mockup. You'll use this as a template when you write out your actual data. Basically, your program is going to output the HTML HEAD section, as plain text, then output a TABLE with all the header tags. When you get to outputting the data, you'll add the appropriate table row and detail tags with your data. Then you'll output the closing tags to your table and HTML body.
That's the hard way of doing it, but is simple in terms of HTML...
The easier way, but requiring a more in depth knowledge of HTML, XML and CSS, is to output an XML formatted version of all your data. You'll have to make up an HTML page that INCLUDES, as a seperate file, the XML data file with all your data formatted in whatever tags you wish to use, and a CSS file that contains the formatting to use for each of these tags. This is a FAR more flexible solution...
RageInTheMachine9532
|
|
|
|
|
Does anybody know how to run a scanner from vb.net. ex. have a button scan a image.
Thanks in advance
|
|
|
|