|
check out visual studio office tools:
www.microsoft.com/downloads/details.aspx?FamilyId=5E86CAB3-6FD6-4955-B979-E1676DB6B3CB&displaylang=en
You got a version for VS2005 (.Net 2.0)
and a version for VS2008 (.Net 3.5)
Using these tools you can write add-ins to word and/or use word's controls.
besides that, if you like you can automate/control word application itself using office interop (just google it). meanning, you can automate real instance of word to do things for you...
|
|
|
|
|
Hi Guys
I want to convert the pdf file to txt file. I'm using this code
private static string parseUsingPDFBox(string input)
{
PDDocument doc = PDDocument.load(input);
PDFTextStripper stripper = new PDFTextStripper();
return stripper.getText(doc);
}
but it throw this exceptions
IOException was unhandled
Error: Header is corrupt ''
Please Help
|
|
|
|
|
|
Hi all,
I need to call a business logic class via web servicing without using reflection. I pass the class name and method as string parameters in the web service. But it doesn't work the conversion from string to an object.
If I pass the object class then it works but I don't want to do that as the webservice must run independently
The code I use is,
[WebMethod]
public object ExecuteMethod(string ClassName, string MethodName, params object[] arguments)
{
object obj = null;
Type type = Type.GetType(ClassName);
try
{
obj = type.InvokeMember(MethodName, BindingFlags.Default |
BindingFlags.InvokeMethod, null, null, arguments);
}
catch
{
throw;
}
return obj;
}
Thanks in advance
|
|
|
|
|
ClassName need to be a fully qualified type name.
BTW: what you are doing is reflection
|
|
|
|
|
Could you provide me with the code without using reflection
Thanks
|
|
|
|
|
Hey, guys.
In searching for a solution to my problem below (http://www.codeproject.com/script/Forums/View.aspx?fid=1649&msg=2645163[^]) about stopping the MS dialog boxes in the WebBrowser control, I've discovered that the IWebBrowser2 interface has a property called Silent that seems to fit the bill. WebBrowser doesn't seem to implement IWebBrowser2 out of the box and embarrassingly, my COM background is in C++ rather than C# so I find myself fumbling a bit.
I'm hoping it's only minor rocket science to derive a new WebBrowser control & implement this interface so that I can get to the Silent property. All I'm using the browser control for is to navigate to a site & then save off an image capture of it to a jpeg. Everything is working fine, but I'm getting hammered by MS messages boxes complaining of scripting errors, unknown publishers, etc. (and I've tried all the browser control properties and IE options to no avail). I'm hoping Silent works as advertised.
Apologies for such a newbie question, but a little guidance in this area from the more experienced hands would be most appreciated. What's the quickest path to getting IWebBrowser2 implemented on the WebBrowser control?
Thanks!
|
|
|
|
|
|
Hey, man.
Thanks for the link, I appreciate it. I actually downloaded and looked at that around 4 AM this morning. He'd done a really nice job on his control, but for both the problem I'm trying to solve and as a simple tutorial on implementing IWebBrowser2, it's major overkill for my needs. He's implementing the interface, but it's buried in with a ton of other stuff and I just don't have the time to dig for it.
I was hoping to find a quicker, simpler, more to the point article entitled, "How to implement IWebBrowser2 when you're just too plain stupid to use COM in C#, in three easy steps." Or something of that sort. One can dream.
I do normally enjoy going through a good book or article, especially of this quality, but it's crunch time on this project (i.e. code till you fall asleep at the keyboard, wake up, code some more) and I'm currently just trying to put out the fire at my feet as quickly as possible. You know how it goes...
|
|
|
|
|
Christopher Duncan wrote: Got a winforms / c# app that uses the webbrowser control to navigate to and then save off a screen capture of the given web site. Unfortunately, trying to run this in a batch
Dude, don't use WebBrowser to scrape a screen. Use networking stuff to get the HTML directly!
led mike
|
|
|
|
|
Actually, I'm doing a fair amount of that in a different portion of the system, but that's a different critter.
What I'm talking about here is saving a screenshot of the web site's home page, which means something needs to read the HTML, handle all 90 gazillion variations of language versions and malformed tags, and then ultimately render that HTML as a graphical image. That's pretty much the short definition of a browser, which is why I'm useing the WebBrowser control to save off the jpeg of the home page screen shot.
Man, if there's a better way to get that jpeg that doesn't require me to deal with browsers, scripting errors, malware, IE popups telling you that they've done something about said malware, etc. then I'm absolutely all for it. Is there something easy and obvious that I'm missing here?
|
|
|
|
|
I am porting a VB6 winsock.ocx based library to a .Net Sockets implementation, and I am not the most savvy sockets programmer. The architecture of the communication system was designed long before I got here; so changing the overall design is not an option. Moreover, this system has a low frequency of tcp traffic, so the Socket.Connected will almost always be out-of-date.
The fundamental issue is the connected property of the socket. It does not seem to be funcitonal; however, I have found others that have had similar issues http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.connected.aspx[^]
When I stepping-through the code in the debugger, unplug the network at the right moment, and view the sock object with the quick watcher, it shows me the value of sock.Connected has changed to false as expected. However, while running the code below, in debug mode but not stepping-through, the behavior of sock.Connected is different (when I unplug the wire, it does not update to false).
Thoughts?
private bool isConnected(){
bool rVal = false;
try
{
bool blcking = sock.Blocking;
try
{
byte[] junk = new byte[2];
sock.Blocking = false;
sock.Send(junk, 1, 0, SocketFlags.None);
rVal = sock.Connected;
}
finally
{
sock.Blocking = blcking;
}
}
catch (SocketException e)
{
rVal = e.SocketErrorCode == SocketError.WouldBlock;
}
return rVal;
}
You can only be young once. But you can always be immature.
- Dave Barry
|
|
|
|
|
Jason McBurney wrote: Thoughts?
My thought is, I hope you are hung up on the concept of interrogating the socket for it's state because that's what you saw in the VG6 *gulp* uh, mess. I hope you appreciate how difficult it is for me to even type VV6, see I just can't do it.
Using exception handling you can can just execute your code and catch exceptions indicating the socket is not connected. You should search around the internet, Sockets.com has been around for ever. Look for examples like the one in the documentation for Socket.Send[^]
led mike
|
|
|
|
|
led mike wrote: VG6, VV6
LMFAO!
Dave
|
|
|
|
|
I don´t know if you got the anser to your question, if not try to download some chat applications here in codeproject.
I started to built one but i didn´t finished it yet, and i didn´t find the code to acomplish all the things i have in my mind.
I´am not an advanced programmer but, i see in your post some similar code to the one i typed (and read before).
Good Luck
|
|
|
|
|
hi
i want to access to the root word storage object, i think i must use "stgopenstorage " win API
i need the code and i want to learn how to use it to access to root word objec,using c# 2003
and the all structured storage API can u give me a good site
thanx
|
|
|
|
|
Is there some reason you don't or can't use the Primary Interop Assembly?
led mike
|
|
|
|
|
which PIA i must use?????????
thanx
|
|
|
|
|
I don't have the requirements for your project, you do. Read the documentation and match it up against your requirements.
led mike
|
|
|
|
|
You've been asking questions here for 2 months about word/c# but have yet to ask a sensible/polite question and certainly no signs of any coding issues.
What exactly are you trying to do, where have you got to, and what parts of coding it are you having difficulty with?
Dave
|
|
|
|
|
hiiii
my work is "data hiding in unused space in structure of word document 2003 "
my problem is" accessing to this struccture and its stream"
now i learn that there is API for accessing root word strcucture storage "openStram"
i reading the artical in this site"read document text directly from microsoft word file"
but the code did't execuded
i need some artical learning me how writing API structure storage
THANX
|
|
|
|
|
This MSDN page[^] has a pdf with all the details of Word 2003 .doc binary file implementation.
I would think it would be far simpler with using Office Open XML[^] but I'm not sure if that format is compatible with word 2003. If it is then check out the open source Package Explorer[^] source code, it may be of some help.
Dave
|
|
|
|
|
Hi,
am using sql 2005 as backend
Am trying to generate auto-incremental values that is preceded with letters from my C# codes, based on user text input into database. The user input could be MAN, LADY, UNCLE etc.
However, I intend to generate values into the database such as:
MAN00001
MAN00002
LADY0001
LADY0002
UNCLE0001 etc.
Kindly show me the way
|
|
|
|
|
Why is it that people keep coming up with requests like this? As a key, this isn't exactly the most efficient.
Anyway, to do this, create yourself a sequence table. This table will consist of the two colums, one for the code and the other for the next sequence number. Then, when you need the value update this table and set the sequence value = sequence value + 1 (use an appropriate locking strategy and run this inside a transaction). Next, read the value back again and subtract 1 to get the sequence you need and commit the transaction. This logic works because the update locks the row for the user who is attempting to get the value. If somebody else attempts to update the row when you are inside the transaction, they won't be able to - they have to wait until you have commited or rolled the transaction back. Note - the order you do this in is hugely important; you must do the update before the select for this to work.
It's a hack, but it's the cleanest way to do it. I've heard of people attempting to do this type of thing using MAX queries and the like, but these are prone to error.
|
|
|
|
|
To display report on Crystal Report I'm using, the following piece of code below.......but I'm not getting any idea of how to SELECT records between a date range ( in my database, the date field doesn't exist in date format, its splitted in multiple columns like MM, DD, YY, YY (i.e 4 columns altogether).
when I display it on Crystal Report, I can concatenate it using built-in Crystal report fucntion called CStr function.
If anyone has got any idea on how to proceed, pls help me.
private void Form2_Load(object sender, System.EventArgs e)
{
try
{
myCon.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\temp\sample_as400.mdb";
myCon.Open();
string sqlQuery = "Select * from table_as400";
myAdp = new OleDbDataAdapter(sqlQuery, myCon);
OleDbCommandBuilder myBldr = new OleDbCommandBuilder(myAdp);
myAdp.Fill(myTable);
}
catch (OleDbException exceptionObject)
{
MessageBox.Show(exceptionObject.Message, "PIN_PROJECT");
}
}
private void btnReport_Click(object sender, System.EventArgs e)
{
CLIENT_REPORT myReport = new CLIENT_REPORT();
myReport.SetDataSource(myAdp);
crystalReportViewer1.ReportSource = myReport;
}
|
|
|
|
|