|
Yes - you can rewrite word, or if you want to only support the new version of Word, you can learn it's XML format and write something that uses that.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I dont want to re-write into a word document..i want to create a new word document..So is there any way??
|
|
|
|
|
|
I am getting the below error
WCF - HTTP Post The remote server returned an error: (400) Bad Request
client & sever code below
--------------------------------------------
ServiceContract]
[WebInvoke(UriTemplate = "", BodyStyle = WebMessageBodyStyle.Bare, Method = "POST")]
Stream SavePerson(Stream input);
-----------------------------
public Stream SavePerson(Stream input)
{
StreamReader streamReader = new StreamReader(input);
string rawString = streamReader.ReadToEnd();
streamReader.Dispose();
// try to store it in xml file
// I want to store the input stream to xml file
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(rawString);
xmlDoc.Save("D:\\a.xml");
//
Encoding encoding = Encoding.GetEncoding("ISO-8859-1");
WebOperationContext.Current.OutgoingResponse.ContentType = "text/xml";
byte[] returnBytes = encoding.GetBytes(rawString);
return new MemoryStream(returnBytes);
}
-------------------------
Client Post
string postData = GetXmlString("d:\\test\\dirdownload.xml"); // user function
WebRequest request = WebRequest.Create("http://abc.xyv.com/mytest/myservice.svc");
// Set the Method property of the request to POST.
request.Method = "POST";
// Create POST data and convert it to a byte array.
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
// Set the ContentType property of the WebRequest.
request.ContentType = "application/x-www-form-urlencoded";
// Set the ContentLength property of the WebRequest.
request.ContentLength = byteArray.Length;
// Get the request stream.
Stream dataStream = request.GetRequestStream();
// Write the data to the request stream.
dataStream.Write(byteArray, 0, byteArray.Length);
// Close the Stream object.
dataStream.Close();
// Get the response.
WebResponse response = request.GetResponse();
// Display the status.
Response.Write (((HttpWebResponse)response).StatusDescription);
// Get the stream containing content returned by the server.
dataStream = response.GetResponseStream();
// Open the stream using a StreamReader for easy access.
StreamReader reader = new StreamReader(dataStream);
// Read the content.
string responseFromServer = reader.ReadToEnd();
// Display the content.
Response.Write(responseFromServer);
// Clean up the streams.
reader.Close();
dataStream.Close();
response.Close();
---------------------------------------------------------
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(rawString);
xmlDoc.Save("D:\\a.xml");
how to save the request input stream to xml file ?
Please advise
|
|
|
|
|
You should post this in the WCF Section here http://www.codeproject.com/Forums/1004114/WPF-WCF-WF.aspx[^]
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
When I call the webservice method from my class synchronously or assynchronously i am receiving the following error:
(System.NullReferenceException: Object reference not set to an instance)
I am being able to call the loadWindow webservice method without any problem but when i pass the dataset as parameter in the saveWindow im receiving the error above. Any solution will be appreciated.
private void SaveData()
{
try
{
SYS_WS sysws = new SYS_WS();
sysws.SaveWindowCompleted +=new SaveWindowCompletedEventHandler(sysws_SaveWindowCompleted);
sysws.SaveWindowAsync((SYSDataset)dsSystem.GetChanges());
}
catch (Exception ex)
{
throw (ex);
}
}
private void sysws_SaveWindowCompleted(object sender,
SaveWindowCompletedEventArgs e)
{
try
{
if (e.Error != null)
{
return;
}
this.dsSystem.AcceptChanges();
}
catch (Exception ex)
{
throw ex;
}
}
[WebMethod(EnableSession = true)]
public bool SaveWindow(SYSDataset ds)
{
try
{
WindowController cont = new WindowController();
cont.SaveWindows(ds);
return true;
}
catch (Exception ex)
{
throw (ex);
}
}
[WebMethod(EnableSession = true)]
public SYSDataset LoadWindow(string WindowID)
{
WindowController cont = new WindowController();
return cont.LoadWindow(WindowID);
}
---- Stack Trace ----
RTR.SYS_V.Setup.frmWindow.SaveData()
frmWindow.cs: line 0091, col 17, IL 0079
RTR.SYS_V.Setup.frmWindow.btnSave_Click(sender As Object, e As EventArgs)
frmWindow.cs: line 0202, col 13, IL 0001
System.Windows.Forms.Control.OnClick(e As EventArgs)
MAIN.EXE: N 00111
System.Windows.Forms.Button.OnClick(e As EventArgs)
MAIN.EXE: N 00073
System.Windows.Forms.Button.OnMouseUp(mevent As MouseEventArgs)
MAIN.EXE: N 00171
System.Windows.Forms.Control.WmMouseUp(m As Message&, button As MouseButtons, clicks As Int32)
MAIN.EXE: N 00654
System.Windows.Forms.Control.WndProc(m As Message&)
MAIN.EXE: N 8788613
System.Windows.Forms.ButtonBase.WndProc(m As Message&)
MAIN.EXE: N 8807204
System.Windows.Forms.Button.WndProc(m As Message&)
MAIN.EXE: N 00031
System.Windows.Forms.ControlNativeWindow.OnMessage(m As Message&)
MAIN.EXE: N 00015
System.Windows.Forms.ControlNativeWindow.WndProc(m As Message&)
MAIN.EXE: N 00048
System.Windows.Forms.NativeWindow.Callback(hWnd As IntPtr, msg As Int32, wparam As IntPtr, lparam As IntPtr)
MAIN.EXE: N 00089
modified on Tuesday, September 1, 2009 2:18 AM
|
|
|
|
|
There are a number of errors in your post (please read the guidelines).
Your title is not acceptable - it is not urgent to anyone but yourself
Your posted code is not inside pre tag and is difficult to read.
You have not indicated where you get the error (what line)
You did describe the error so I can tell you there is an object that is declared but not initialised. Try debugging through the code to identify the line, look for an object that is 'null' where you expect it to have a value.
|
|
|
|
|
hi sir,
i remodified the document..concerning to the code i debugged i am loading the record and then modify data and save.
i checked the rows.count its 1 dataset is not null.
The line that im receiving the error is before calling the save webservice method.
SYS_WS sysws = new SYS_WS();
-->sysws.SaveWindowCompleted +=new SaveWindowCompletedEventHandler(sysws_SaveWindowCompleted);
<br />
Soap exception is thrown :<br />
soap System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object.
thanks for your help
|
|
|
|
|
|
You can't. How do you expect to get progress notification from Word ?
If you're taking steps in your own code, you show a progress bar, as explained in a ton of articles.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i am opening the word document from my code.so there must be some way to show progress bar
|
|
|
|
|
Swetha Srinivasan wrote: there must be some way to show progress bar
Sure there is, there are many articles here on progress bars. However what CG was referring to is how are you going to define the progress of the open function. This is why there is a little circular animation used, you have no idea how long it will take.
|
|
|
|
|
|
|
I really am at a loss. What have you tried, anything ? Showing a little busy icon while you open a document is so trivial, that I can't believe you've done anything beyond asking us to write it for you
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
how to disable close button of windows form. i donnot want any one to close the application.
or
In my application i want to disable the closing of the applciation by user. only the administrator can close.
can any one help ..............
This code was posted by me...
|
|
|
|
|
Property ControlBox=false
Use event FormClosing and set e.Cancel=true.
|
|
|
|
|
You can set
Form.ControlBox=false;
but this also removes the Min, Max, and system menu from the form as well.
To grey out the Close box, override the CreateParms getter:
protected override CreateParams CreateParams
{
get
{
CreateParams parms = base.CreateParams;
parms.ClassStyle |= 0x200;
return parms;
}
}
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
you can do it like this
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
but, you need to write methods such as 'MovingForm'or 'ResizeForm' or something else by yourself.
|
|
|
|
|
|
Hi.
What is the difference between Console.WriteLine(); and Console.Out.WriteLine(); ?
Thanks
|
|
|
|
|
There is no difference. Because writing data to the console is so ordinary MS decided to expose the common.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
Thanks
Md. Marufuzzaman
|
|
|
|
|
Nothing. Out returns the standard output stream for the Console. Both WriteLine methods you posted send their output to that stream.
|
|
|
|
|
Dave Kreskowiak wrote: Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...
I wonder if they just kick people out after three years ? That's how long I was in.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I don't know about that. I've seen some people in for longer, especially those who do a lot of speaking at user gruop meetings and write entire books in their blogs.
Sorry, but my son in more important than that...
|
|
|
|