|
Imports System.Io
.
.
.
Dim myFilePath As String = Path.Combine(Application.StartupPath, "myFileName.txt")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have create the bookmark in the middle of a sentence named "a"
How can I define a range(word.range) that marked start at the begin of "a",
and the end at 5 charaters after(right hand side) the bookmark?
What I want to do is like this, but I don't want the user see what is highlighted.
<br />
oWord.activeDocument.range.GoTo(Word.WdGoToItem.wdGoToBookmark, Word.WdGoToDirection.wdGoToAbsolute, 1, "a")<br />
oWord.Selection.MoveRight(Word.WdUnits.wdCharacter, 5, Word.WdMovementType.wdExtend)<br />
MyData = oWord.selection.text<br />
Thank You!
|
|
|
|
|
Oh, I found my code is wrong,
anyway, please advise for the text description.
Thank you !
|
|
|
|
|
I am trying to receive xml files on my server which are posted from another server using http post. I need help in designing a receiver which will accept this xml file and send back a success message back to the sender. Can someone give me some code examples on how to design this piece? I am having difficulty proceeding with the design here. Any help will be appreciated. You can also email me code samples at jacktundra@removethis-hotmail.com
|
|
|
|
|
Hi all,
I am trying to do a simple database display ( 1 combo box 3 or 4 textboxs in readonly) and then have a it all controled by a class.
i can get this done already if i dont use a class and just bind the combo / textboxes to the database but im really stumped on how to do it in a class
can anyone help me out?
|
|
|
|
|
I think you have set connectivity to database out of class what is preventing you in creating the tiers. My suggestion for easiet solution would be try to connect to database inside the class so you can easily pass the values from db to combo or text boxes with SET Values... You could easily populate those withing the class...
Just another perspective!
|
|
|
|
|
Hi All,
Ok I've been at this for a week now and obviously I don't get it. I've got some of the code right cause it does work but as soon as I try to save a url it tells me that URI's cannot be put into a richtext box. ?? I have a button that opens a SaveFileDialog box and the way it is now works just fine but when I try to save the url that's in my AxWebBrowser it doesn't work. What I am doing wrong here? What am I just not getting? (Yes Newbbie )
This is my code for the button so far:
Private Sub Faves_b_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Faves_b.Click<br />
<br />
' Find the directory of the user's Favorites.<br />
<br />
Dim objRegKey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser<br />
<br />
Dim objFav As Microsoft.Win32.RegistryKey = objRegKey.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders")<br />
<br />
Dim strFavoritesPath As String = objFav.GetValue("Favorites")<br />
<br />
' Set properties of Dialog-box.<br />
<br />
Dim myStream As Stream<br />
<br />
Dim SaveFileDialog As New SaveFileDialog<br />
<br />
Dim URLName = AxWebBrowser.LocationName<br />
<br />
Dim URLAddress = AxWebBrowser.LocationURL<br />
<br />
SaveFileDialog.Title = "Add To Your Favorites"<br />
<br />
SaveFileDialog.InitialDirectory = strFavoritesPath<br />
<br />
SaveFileDialog.FileName = URLName<br />
<br />
SaveFileDialog.Filter = "URL Files (*.url)|*.url"<br />
<br />
SaveFileDialog.FilterIndex = 1<br />
<br />
SaveFileDialog.DefaultExt = "*.url"<br />
<br />
SaveFileDialog.RestoreDirectory = True<br />
<br />
' Now display the SaveFileDialog so the user can save the url.<br />
<br />
SaveFileDialog.ShowDialog()<br />
<br />
' If the file name is not an empty string save it .<br />
<br />
If SaveFileDialog.FileName <> "" Then<br />
<br />
Dim RichTextBox As New RichTextBox<br />
<br />
RichTextBox1.LoadFile(URLAddress)<br />
<br />
RichTextBox.SaveFile(URLAddress, RichTextBoxStreamType.RichText)
End If
End Sub
Thanx to anyone that can contribute to the "Help the Newbbie Program"
|
|
|
|
|
All youre'trying to do is save a URL as a shortcut somewhere, right?
Deceptively easy! Have you ever just opened one in Notepad? All you have to do is create a normal text file, with the filename ending in .URL and write this to it:
[InternetShortcut]
URL=urlPath
For example, Yahoo.URL:
[InternetShortcut]
URL=http:
I have no idea what you're trying to do with a RichTextBox. It doesn't support loading HTML files...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 10:19 Thursday 9th February, 2006
|
|
|
|
|
Hey someone answered. lol I posted this in a couple of different forums and this is the only one that's answered me. Yes all I'm trying to do is save a url link from my browser. That's it! I've tried just saving a text file with the url extension but again I must be doing something wrong cause I can't seem to get it to write on the file. Can you help me out with this too?
|
|
|
|
|
Well, in the code that you posted, you didn't open any file and write anything to it. The RichTextBox won't do anything for you and you're using it's methods incorrectly.
You're looking for something most like this:
If SaveFileDialog.ShowDialog = DialogResult.OK Then
Dim fs As Stream = SaveFileDialog.OpenFile()
If Not (fs Is Nothing) Then
fs.WriteLine("[InternetShortcut]")
fs.WriteLine(String.Format("URL={0}", URLAddress))
fs.Close()
End If
End If
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave,
When I put the code in there it tells me that "WriteLine" is not part of System.IO.Stream???
|
|
|
|
|
Too damn sleepy last night. A little simpler:
If SaveFileDialog.ShowDialog = DialogResult.OK Then
Dim sw As New StreamWriter(SaveFileDialog.FileName)
sw.WriteLine("[InternetShortcut]")
sw.WriteLine(String.Format("URL={0}", URLAddress))
sw.Close()
End If
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave,
Thank you very much, it works just fine now. Now that I can add to favorites, the next step is to open them in my WebBrowser.
Thanks for your help
|
|
|
|
|
Start it in a browser on your form or just launch the thing like someone double-clicked the shortcut on the desktop?
If it's to launch the shortcut like double-clicking it, then all you have to use is use the Process class.
Dim newProcess As New Process("filename.url")
newProcess.Start()
If it's a browser on your form, then all you have to do is call the browser's .Navigate() method, passing in the full path to the *.URL file.
WebBrowser1.Navigate("filename.url")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
HI Dave,
Yeah I want to open the url link in my browser on my form. The Code you wrote is what I was thinking of putting. Glad to see I'm thinking in the right direction.
One thing though that I noticed as I was testing the first code you helped me on was that the names of some pages have these "<, >, *, |, :, \, /, &, %, ", ., #, ?" type characters and therefore the expected error comes up that the page name is not valid for saving. Now if you remember I'm taking the Variable URLName = WebBrowser.LocationURL string and using that as the SaveFileDialog.FileName. Could you dirrect me in the right track in order to check if the URLName variable has any of those characters and change them to a usable character like maybe the "-" or "_" characters before it is used in the SAveFileDialog box as the FileName?
-- modified at 23:39 Friday 10th February, 2006
|
|
|
|
|
|
Perhaps if you write the question in the text instead of in the subject, you will have room enough to describe the problem so that anyone can help you.
---
b { font-weight: normal; }
|
|
|
|
|
I'm trying to create a wizard with a tabstrip control. but I want to use command buttons to move next previous etc...
<br />
Private Sub isBtnPrevious_Click()<br />
TabsWizard.Value = TabsWizard.Value - 1<br />
End Sub <br />
doesn't move the tabs rather it errors out "Method or data member not found" with the ".value" highlighted
any help would be greatly appreciated
|
|
|
|
|
You can use this
Private Sub isBtnPrevious_Click()<br />
On Error Resume Next<br />
TabsWizard.Tabs(TabsWizard.SelectedItem.Index - 1).Selected = True<br />
End Sub
chatura
|
|
|
|
|
Okay! Create two buttons on the form for (next and previouss) and place your tab control on to form also (I assume that it is Tabcontrol1 with n tab pages). You should have a global variable which will track the index number with increments or decreaments... Here is the part of an example...
Public TABINDEX as Int32 = 0
'Next button
Private sub Button1_Click(Sender, e) handles button1_click
TabIndex +=1
if Tabindex > Tabcontrol1.tabpages.count Then
TabIndex = TabControl1.tabPages.count
end if
TabControl1.SelectedIndex = TabIndex
End Sub
Do the opposite thing for the deacrement and use
Private Sub Button2_Click(Sender, e) handles Button2_Click
'Previous button
TabIndex -=1
if TabIndex < 0 Then
tabindex = 0
end if
TabControl1.SelectedIndes = TabIndex
end sub
|
|
|
|
|
Hi guys,
I want to built a program to recieve e-mails.
From Outlook Express I "connect" to mail.uth.gr (pop3) with password and username, so I download my e-mails.
So, suggest me some links in Web that I can take knowledge to make this project.
There is a .com Referecne Outlook Library 10.0, It's necessary for this prog?
Thanx in advance..
-- modified at 20:13 Wednesday 8th February, 2006
|
|
|
|
|
Working on a project and i want to use flash to spice up the user interface. However I dont' know how to set a Flash button to work with the VB form. If anyone can help me out or point me to a good ref on how to bind flash to VB events please let me know,
|
|
|
|
|
This is an example.
Flash MX
Create a button.
Select “Window” menu. Select “Development Panel --> Actions”
In the code editor, type this
on (release) {
fscommand ("Button1");
}
Save the movie. (“Untitled-1.fla”)
Select “Control” menu and Select “Test Movie”
Flash will create (“Untitled-1.swf”)
Exit from Flash.
VB.Net
Right click on the tool box. Select “Add/Remove Items…”. Select “COM Components”
Select “Shockwave Flash Object”. Click OK
Draw it on the form
Name it “SF1”
Right click on “SF1” and select “Properties”
Type the path to “Untitled-1.swf” in the “Movie URL” textbox.
Click OK
Double Click on SF1 ( go to Code Editor )
Select “FS Command” from Procedure List Box
Type this
Private Sub SF1_FSCommand(ByVal sender As Object, ByVal e As AxShockwaveFlashObjects.DShockwaveFlashEvents_FSCommandEvent) Handles SF1.FSCommand
If e.command = "Button1" Then
MsgBox("it works")
End If
End Sub
Run the program
Click on Button1
chatura
|
|
|
|
|
what can i SAY
thist has got to be one of the coolest code I've learned for the last 10 months
Marvin N. Guerrero
- Taje Kage_bunshinNunJutsU
|
|
|
|
|
Thank you!
chatura
|
|
|
|