|
Thank you for your reply (and for taking the time...), just to make the point clear this is NOT a "For profit" application. I have like 700+ files I need to perform multiple edits to. The issue is that if I knew how to transfer it over to VB.NET I would have done, but unfortunately I don't.
Any ideas are greatly welcome.
Appreciate the help.
|
|
|
|
|
To do what that VBA is doing (in MS office) it would required MS office automation (profit thing was just a referance to the Underpants Gnomes[^])
|
|
|
|
|
Hello,
You are right I would need the VSTFO to program for Word persay, but I think there is a different (easier way) to achieve the same results using the "StreamReader". I got this code from someone else (don't know where it came from): (NOT coded by me ALL credits to the author)
The thing is to be able to search for multiple "words" or "code" and be able to replace just as the aforementioned word macro does.
string find = txtFind.Text; <br />
int replaced = 0;<br />
<br />
string[] fileList = Directory.GetFiles(@"C:\text files", "*.txt", SearchOption.AllDirectories);<br />
<br />
foreach (string file in fileList)<br />
{<br />
StreamReader sr = new StreamReader(file);<br />
string content = sr.ReadToEnd();<br />
sr.Close();<br />
<br />
if(ReplaceText(ref content, txtFind.Text, txtReplace.Text, ref replaced))<br />
{<br />
StreamWriter sw = new StreamWriter(file);<br />
sw.Write(content);<br />
sw.Flush();<br />
sw.Close();<br />
} <br />
}<br />
MessageBox.Show("Total replacements = " + replaced);<br />
|
|
|
|
|
I got the program to work the way I need it, the problem now is to be able to select multiple items and to individually swap one by one I guess.
|
|
|
|
|
i want source code wordpad in c# please healp me
|
|
|
|
|
negar777 wrote: i want source code wordpad in c# please healp me
[STAThread]
static void Main()
{
} I leave the rest up to you.
|
|
|
|
|
I want doesn't get.
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
You mean use a Rich Text Box control in a resizable winform?
|
|
|
|
|
Actually, I think he wants the ENTIRE Source-Code for Wordpad, as if it was coded in C#.
It's like a:
"I need help coding this. Can you code it instead, and give me the source code?" type of question, but very badly phrased
|
|
|
|
|
Like the one in my sig
|
|
|
|
|
because i dont speack english ok
|
|
|
|
|
|
|
|
My guess would be the changes are
1) You editing the file
2) Windows changing the last modified date / antivirus / some file system filter driver
|
|
|
|
|
That's correct behavior. Although you would think one event should be generated, there are actually more file io events happening under the covers that may generate the notification. I'm working with FileWatcher right now and sometime I get four change events when saving a file.
only two letters away from being an asset
|
|
|
|
|
Hello everyone,
When we signal an event (say, invoking set method of ManualResetEvent instance), then two basic questions,
1. no matter how many threads are waiting on the event, all of them will be awoken and executed at the same time, right?
2. If some other threads execute to statement WaitOne, after the ManualResetEvent is signalled -- say, in step (1), but not reset back into non-signalled status, the thread's execution will not be blocked, right?
thanks in advance,
George
|
|
|
|
|
Yes, both are correct. An AutoResetEvent will only release one thread, a ManualResetEvent releases all waiters. Any future thread calling WaitOne (or WaitAny, or WaitAll if all the other objects are also signalled) will be released immediately without blocking, until the event is reset.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Cool, Mike!
Question answered.
regards,
George
|
|
|
|
|
I created a Property Grid and it displays an description at the bottom.
Can anyone please let me know hoe to remove it.
I tried with Description(null) and descriptionattribute(null) , but still it shows the description
Thanks !
|
|
|
|
|
It's cunningly hidden as a property.
progressbar.HelpVisible = false;
|
|
|
|
|
Thanks for your Help . It worked. Not Sure Why in .NET they have did the property Like that !
|
|
|
|
|
i am trying to update my customers table in the northwind database from XML file.
Getting an Wrror
Violation of PRIMARY KEY constraint 'PK_Customers'. Cannot insert duplicate key in object 'dbo.customers'.
i used SqlCommandBuilder to build insert,update and delecte commands.
DataSet DSRead = new DataSet();
DSRead.ReadXml("output.xml");
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand (queryString, connection);
SqlCommandBuilder builder = new SqlCommandBuilder(adapter);
connection.Open();
DataSet dataSet = new DataSet();
adapter.Fill(dataSet, tableName);
dataSet = DSRead;
//code to modify data in DataSet here
builder.GetUpdateCommand();
//Without the SqlCommandBuilder this line would fail
adapter.Update(dataSet, tableName);
how can i write CommandBuilder to update, insert and delete.
Thx
|
|
|
|
|
How can i use forgot option in asp.net
|
|
|
|
|
Hi,
Does anyone know how to send parameters through to a crystal report in VS 2008?
I keep on getting this dialog that asks me to enter the discrete value of the parameter.
I would like to send the parameter value through code once the user has selected their filter choice.
This is for Windows Form application and I'm using SQL 2005 Express as the database.
I have googled but cant find a working solution.
Thanks
|
|
|
|