|
Print the Word doc on the fly to an XPS document, and then load the XPS document into a WPF DocumentViewer control in a WPF window or host the Viewer in a Windows Form.
|
|
|
|
|
hi
would you please provide me the detail to how i can resolve the problem..
since i had never used the XPS format ..
and how i will be reading that format using asp.net (C#)..
to display the content in the textbox.
regard
vimal
|
|
|
|
|
You didn't mention that you were using ASP.NET in your original question.
Since that's the case, just open the Word document in an new IE Window and forget about using a control. XPS documents can be opened in IE also; so, no difference in that case.
(And I said to use a "DocumentViewer" control for XPS; not a TextBox. In any case, a DocumentViewer can only be hosted in Windows).
|
|
|
|
|
vimalkumarsinghal wrote: it work fine for me but it does not carry the formating done in the ms-word , it shows all the content in the plain text
Of course it doesn't work! First of all, the TextBox control doesn't know anything about Word formatting and cannot render what it doesn't know how to do. Second, you're getting only the text from the Word document, not the formatting.
Basically, you can't do what you want using a TextBox control.
|
|
|
|
|
Save the word document as RTF and use RichTextBox to display the content.
|
|
|
|
|
hi
Do we have the richtextbox control in asp.net 3.5..
would you please guide me the way i can achieve this..
regard
vimal
|
|
|
|
|
I was talking about Windows Application. There is no way (as far as I know) where you can interactively display Word document on a web page.
You may try to convert the Word doc into html format and display it in an iFrame.
|
|
|
|
|
hello to everyone.. i want to ask how to do this code in vb.net.. becuase i am newly in the vb.net .. i only got correctly in vb6.. there are some differences but i think their almost the same.. can you help me guys to do my program..?? my problem is that i cant generate the voice... it gives me error but in vb6 its working properly.. i am using now vb.net and sapi 5.1.. my OS windows XP.. this is like an ordering application..
here's my code...
Public Class main<br />
<br />
Public gmode As Integer<br />
Public gRestoreGrammar As Boolean<br />
Public additional As Boolean<br />
<br />
Private Sub AxDirectSR1_PhraseFinish(ByVal flags As Long, ByVal beginhi As Long, ByVal beginlo As Long, ByVal endhi As Long, ByVal endlo As Long, ByVal Phrase As String, ByVal parsed As String, ByVal results As Long)<br />
If (parsed = "") Then<br />
AxDirectSR1.Deactivate()<br />
If (Rnd() > 0.5) Then<br />
AxDirectSS1.Speak("kindly repeat your order again sir.")<br />
Else<br />
AxDirectSS1.Speak("please follow the menu.")<br />
End If<br />
Else<br />
If (parsed = "ok") Then<br />
AxDirectSR1.Deactivate()<br />
If (additional = False) Then<br />
gmode = 2<br />
AxDirectSS1.Speak("Would like to have drinks?")<br />
<br />
Else<br />
gmode = 3<br />
AxDirectSS1.Speak("would that be all sir?")<br />
End If<br />
ElseIf (parsed = "cancel") Then<br />
Dim Item As String<br />
Item = ListBox1.Items.Count - 1<br />
If (Item >= 0) Then<br />
ListBox1.Items.Remove(ListBox1.Items.Count - 1)<br />
AxDirectSR1.Deactivate()<br />
AxDirectSS1.Speak("your order cancel")<br />
End If<br />
ElseIf (parsed = "no") Then<br />
If (gmode = 2) Then<br />
gmode = 3<br />
additional = True<br />
AxDirectSR1.Deactivate()<br />
AxDirectSS1.Speak("verifying your order")<br />
ElseIf (gmode = 3) Then<br />
gmode = 0<br />
gRestoreGrammar = True<br />
AxDirectSR1.Deactivate()<br />
AxDirectSS1.Speak("you can continue your order")<br />
Else<br />
gmode = 0<br />
gRestoreGrammar = True<br />
End If<br />
ElseIf (parsed = "yes") Then<br />
<br />
If (gmode = 2) Then<br />
'form2.Show()<br />
gmode = 3<br />
AxDirectSR1.Deactivate()<br />
AxDirectSS1.Speak("would that be all")<br />
<br />
ElseIf (gmode = 3) Then<br />
Dim total As Integer<br />
total = 0<br />
For i = 0 To ListBox1.Items.Count - 1<br />
total = total + Val(ListBox1.Items(i))<br />
Next i<br />
ListBox1.Items.Add("---total is: $" + Format(total, "###0.00"))<br />
gmode = 1<br />
gRestoreGrammar = True<br />
<br />
AxDirectSR1.Deactivate()<br />
<br />
AxDirectSS1.Speak("Your total will be $" + Format(total, "###0.00") + " at the next window please.")<br />
End If<br />
Else<br />
AxDirectSR1.Deactivate()<br />
ListBox1.Items.Add(parsed)<br />
End If<br />
End If<br />
<br />
ListBox1.SelectedIndex = ListBox1.Items.Count - 1<br />
AxDirectSS1.Speak(Phrase)<br />
<br />
End Sub<br />
Private Sub DirectSS1_AudioStop(ByVal hi As Long, ByVal lo As Long)<br />
If (gmode = 1) Then<br />
ListBox1.Items.Clear()<br />
gmode = 0<br />
AxDirectSS1.Speak("Hi! May I take your order?")<br />
Else<br />
If (gmode = 2) Or (gmode = 3) Then<br />
<br />
AxDirectSR1.GrammarFromFile("C:\Documents and Settings\kaex21\My Documents\Visual Studio 2008\Projects\Project1\WindowsApplication6\WindowsApplication6\yesno.txt")<br />
<br />
ElseIf (gRestoreGrammar) Then<br />
<br />
AxDirectSR1.GrammarFromFile("C:\Documents and Settings\kaex21\My Documents\Visual Studio 2008\Projects\Project1\WindowsApplication6\WindowsApplication6\menu.txt")<br />
gRestoreGrammar = False<br />
<br />
End If<br />
REM we had to turn off listening before talking, so now that we are done talking we<br />
REM should start listening again<br />
AxDirectSR1.Activate()<br />
End If<br />
End Sub<br />
<br />
Private Sub main_Terminate()<br />
AxDirectSR1.Deactivate()<br />
End Sub<br />
<br />
<br />
<br />
Private Sub LinkLabel2_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel2.LinkClicked<br />
Form5.Show()<br />
Visible = False<br />
<br />
End Sub<br />
<br />
Private Sub Label9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label9.Click<br />
<br />
End Sub<br />
<br />
Private Sub GroupBox18_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox18.Enter<br />
<br />
End Sub<br />
<br />
Private Sub LinkLabel3_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel3.LinkClicked<br />
End<br />
End Sub<br />
<br />
<br />
Private Sub main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
gmode = 0<br />
gRestoreGrammar = False<br />
<br />
On Error GoTo GeneralFail<br />
REM we just use this function once, on the first callback, then the timer isn't needed anymore<br />
Dim engine<br />
REM Initialize the recognizer. We want command and control, so find and select that engine (or best match)<br />
AxDirectSR1.Initialized = 1<br />
<br />
engine = AxDirectSR1.Find("MfgName=Microsoft;Grammars=1")<br />
AxDirectSR1.Select(engine)<br />
<br />
REM Burger.txt is our uncompiled grammar. Compile and load it now.<br />
AxDirectSR1.GrammarFromFile("C:\Documents and Settings\kaex21\My Documents\Visual Studio 2008\Projects\Project1\WindowsApplication6\WindowsApplication6\menu.txt")<br />
REM Now load the synthesizer, find and select any female voice from microsoft<br />
AxDirectSS1.Select(AxDirectSS1.Find("MfgName=Microsoft;Gender=1"))<br />
<br />
REM Start the voice interface...control goes to DirectSS1_AudioStop after this is said, gMode=0<br />
AxDirectSS1.Speak("Welcome to kaex restaurant, sit back and enjoy as you take your order.")<br />
<br />
REM sometimes the vb environment comes to front while we're loading, so take the screen back<br />
Me.Show()<br />
GoTo done<br />
GeneralFail:<br />
MsgBox("Unable to start using text to speech or recognition.")<br />
done:<br />
<br />
End Sub<br />
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick<br />
<br />
End Sub<br />
<br />
End Class
|
|
|
|
|
Its quite difficult to write down the full code, but if you can tell us what error you are getting then we may help you.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
sorry for putting down all my codes..
here's the line of code which ive got error..
Private Sub main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load <br />
gmode = 0<br />
gRestoreGrammar = False<br />
<br />
On Error GoTo GeneralFail<br />
<br />
REM Initialize the recognizer. We want command and control, so find and select that engine (or best match)<br />
AxDirectSR1.Initialized = 1<br />
dim engine as string<br />
engine = AxDirectSR1.Find("MfgName=Microsoft;Grammars=1")<br />
AxDirectSR1.Select(engine)<br />
<br />
REM menu.txt is our uncompiled grammar. Compile and load it now.<br />
<br />
AxDirectSR1.GrammarFromFile("C:\Documents and Settings\kaex21\My Documents\Visual Studio 2008\Projects\Project1\WindowsApplication6\WindowsApplication6\menu.txt")<br />
REM Now load the synthesizer, find and select any female voice from microsoft<br />
AxDirectSS1.Select(AxDirectSS1.Find("MfgName=Microsoft;Gender=1"))<br />
<br />
REM Start the voice interface...control goes to DirectSS1_AudioStop after this is said, gMode=0<br />
AxDirectSS1.Speak("Welcome to kaex restaurant, sit back and enjoy as you take your order.")<br />
<br />
REM sometimes the vb environment comes to front while we're loading, so take the screen back<br />
Me.Show()<br />
GoTo done<br />
GeneralFail:<br />
MsgBox("Unable to start using text to speech or recognition.")<br />
done:<br />
<br />
End Sub
it always say "unable to start using text to speech or recognition becuase it has an error.. and directly it go to generalfail.. it means i have an error above my codes.. can you help me sir how to correct this one?? in newly in vb.net.. this code that ive been working is fully functional in vb6.. but in vb.net is not..
|
|
|
|
|
It seems you are using a COM component to recognize speech. In that case, you have to add a reference to the COM component in VS and it will create a RCW for you. And then remove error handling from the procedure that is giving you the error, this will enable you to nail down to the exact line that is causing the error.
|
|
|
|
|
Error : Section or group name 'system.web.extensions' is already defined. Updates to this may only occur at the configuration level where it is defined.
I have a web application project which developed under 3.5 .net framework. Also there is a virtual directory under the project that developed in 2.0 .net framework. These two sections belongs to their web.config file.
Root Project’s config : <sectionGroup name="system.web.extensions" type= "System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
Virtual Directory’s config : <sectionGroup name="system.web.extensions" type= "System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
|
|
|
|
When ASP.NET reads configuration information it starts at the highest level, with machine.config, and works downward in the chain. The virtual directory is below the root and can't redefine this element, especially to a lower version. Remove it and it should work fine.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi all,
I try to create a client program on a mobile device which sends every 5 or 10 seconds a MySQL Query/Command to update the database with many of informations like Software version of each mobile device.
My question is: is it clever to this on this way or do I have to much traffic on network when 1000 clients sends at the same time a mysql query/command to a mysql server every 5 or 10 seconds the whole day?
The planing infrastructre of this solution is the following:
- I have one MySQL Server which contains information of all mobile devices
- I have a management console that query the MySQL server to get this information
- I have 1000 mobile devices that sends every 5 or 10 seconds their information like S/W version/Bootloader version etc. to the MySQL server
So can I make it this way or I'm on a wrong way?!
Thanks for your qnswers,...
Walter
|
|
|
|
|
nxexo007 wrote: I have 1000 mobile devices that sends every 5 or 10 seconds their information like S/W version/Bootloader version
Is this information really going to change every 5 to 10 secnds?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
First of all, thank you for your reply.
So, this information doesn't change every 5 to 10 seconds.
But the thing is, that I want to update the last online time of the mobile device,
so I can see that the unit is online now.
Every 5 or 10 seconds the unit will notify himself on the database.
The table will looks like this:
[S/N] [Devicename] [IP] [LastOnlineTime] [S/W-Version] and so on...
Then the management console will check the [LastOnlineTime] column and then I know when the device was last time online.
And every mobile device will do this (1000 units are in the network). In this way I can see how many devices are online now.
It's a kind of online notifyer for mobile devices.
My question is, can a MySQL server handle this and is that not to much traffic for the network?
Or is this solution a little bit sh*t.
|
|
|
|
|
I would think MySQL should be able to handle it. The question is more whether the network will support it and if your application can as well.
If all you need to know is if the device is online, then you don't need to transmit all the data you are asking for. A simple reply with the device ID would be enough.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
What do you mean with:
Mark Nischalke wrote: A simple reply with the device ID would be enough.
Is this a reply to the database or do you mean a reply over UDP to the management console?
|
|
|
|
|
It's your application, you determine where the reply should go.
You don't need to transmit everything about the device just to know it's online. Just transmitting the device ID, one piece of information, will be enough to know that its online right? Why send 50 bytes over the network when 2 bytes is enough?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hmm,
Ok thank you I will try it like you say.
But I need although the information like S/W version.
So, I can send a command over UDP to all units, so that the units will update their information to MySQL database. And this I do not always, I do this just from the management console when I want and not every 5 or 10 seconds.
Or I will made a pilot-test with 500 units in this network, to test the MySQL performance with my for solutions idea.
I don't know, I have to think about it...
|
|
|
|
|
Send all the information like S/W, bootloader version, etc. only ONCE and send a 'ping' to the database every 5 or 10 mins along with the Device ID. The date/time the ping was received will be the last online date/time of the device. MySQL is a solid database used worldwide for production purposes, and if properly configured, it can easily handle millions of transactions per second. So that should not be a problem.
|
|
|
|
|
Is there a library available that implements the entire Windows API (via System.Runtime.InteropServices )?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Not that I know of
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
if you mean one or a few classes that wrap the content of kernel32.dll and user32.dll and the like, the answer is no, unfortunately. I started such classes years ago, and each time I need another Win32 function, I add its prototype to them, but that is a never ending endeavor.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
That'll only happen when Microsoft rewrites the entire kernel in managed code.
|
|
|
|