|
Hi there,
I'm trying to write a piece of code to convert an Outlook OFT file into a html file.
(If you try SaveAs HTML from Outlook, it doesn't save the attached images)
Using the Outlook.MailItem object, I can iterate through the attachments, but I cannot seem to locate the ContentID for the attachments (I need this in order to figure out which image attachment belongs to which tag).
Anybody done this before?
Thanks,
David
|
|
|
|
|
http://sites.google.com/site/neotechni/_/rsrc/1240164453045/Home/iamerror.png
the 0,0 oriented part is the source material the stuff in the square is the output. vb seems to be destroying it during rendering. I dont understand, it looks like scaling artifacting, but its rendering each tile at the proper size (16x16)
(please) help?
|
|
|
|
|
Hi
I am looking to see if I can trap when a user clicks on the save and print icons using their mouse in word. Now, you probably asking what a stupid question, but stick with me! What I have is this, I have an ASP web site running through my bespoke web browser control, and in my website running on an intranet, I have an iframe, which in turns shows a word document.
However, when the word document is displayed it has all the word tool bars. The easiest way would be turn things off registry wise, but this, I am told, would go if the user was to use it normally. Unfortunately, I haven't been able to use an Active X control, for some reason that gives me back blank. So, I was wondering if there is a way of trapping these events through the browser control as we don't want the user to do anything locally.
I am okay with hot keys, it is how to stop mouse events.
Last thing, I am not looking for anything complicated, just simple, nice and neat code would be great!
|
|
|
|
|
So your form has a browser control, and in that, you show a word document ? I think you're fighting a losing battle - the user can configure that toolbar, right ? So how would you know what button was at a specific mouse point ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi
I just need some help to refine some code I am writing inside the function above in Windows form, which includes a web browser control.
In my code so far I have written if msg.WParam = keys.controlkey then return true. Now this works fine, but what I am really trying to do is capture key combinations, like control & c. So, I changed it and said if msg.WParam = keys.controlkey And msg.WParam = keys.c then return true. Unfortunately, it is only capturing the control key, and if I change it to an OR then it only captures the c, which is not what I want.
Is there a quick way to get both at the same time? I am not looking for lots of complicated code, just something neat and simple.
|
|
|
|
|
Hi,
msg.WParam cannot have two different values at the same time.
you can get the instantaneous value of the modifier keys through Control.ModifierKeys, so check that together with msg.WParam==(int)'c'
|
|
|
|
|
Hi
Thanks for your reply.
But can you give me an example of some code, because I am unclear on how to piece it together.
Thanks
|
|
|
|
|
I'd rather not. My VB isn't fluent and will confuse rather than help you.
|
|
|
|
|
If you are trying to capture the Ctrl Key plus an alpha char, like 'C', in ProcessCmdKey I believe the following will work:
If keyData = (Keys.Control + Keys.C) Then
' whatever
Return True
End If
In this case the keyData parameter is handier than the message parameter.
|
|
|
|
|
Hi
Thanks for your advice
I tried it and it skipped over the if statement. In debug mode I hovered over the keyData variable and its value was 131089, whereas keys.control was 131072 and C was 67. Therefore, it will never equate to true.
Also I noticed that won't work because the function is fired twice, which must be because there is two key strokes?
Does anyone have any ideas?
|
|
|
|
|
AndyASPVB wrote: Also I noticed that won't work because the function is fired twice, which must be because there is two key strokes?...
Have you tried running the code without stepping through the debugger? I believe ProcessCmdKey may fire twice under this scenario with the first firing showing keyData as the modifier key values summed (e.g., Keys.Control + Keys.ControlKey), and the second firing being, from my code example (Keys.Control + Keys.C).
At any rate, I know the sample I gave you works for me with VS 2003 or VS 2005 for capturing modifier key combinations in ProcessCmdKey (whether it be Alt or CTRL with another key). If it really is not working for you, I'm sorry I don't know why. I have not tried this under VS 2008 and, if that is what you are working under, maybe there is some slightly different behavior.
|
|
|
|
|
Yes, I am working under VS 2008.
And what I wrote was in debugger mode and this is what was happening. When I switch off debugger, and just run it, nothing fires. I know nothing is firing because nested inside the if statement is a messagebox with a little message.
Could the type of machine the code is running have any influence?
|
|
|
|
|
Thanks this worked for me in c++ to be able to enabling panning with arrow keys. Holding ctrl at the same time enables micro panning.
|
|
|
|
|
I've done a lot of research into this problem and I'm not exactly sure how to tie all I've found together into a cohesive app...
Here's my situation. I built a rather simple web app that has a textbox and a button. If you put HTML code in the box and click the button, it embeds the code into the page. Simple, right?
Well I had this idea that instead of just embedding the code into the page, it stored the code for later usage, like an RSS feed. Well...not like an RSS feed, A RSS feed.
But here's the deal, HTML doesn't store well in XML. There are multiple ways of doing so (like CDATA), but I'm not sure which is best for later retrieval and embedding.
Is someone willing to assist me in learning which methods are best for storing HTML code in an RSS feed and how to later parse and embed the code written to it?
|
|
|
|
|
HttpUtility.HtmlEncode is probably what you are looking for.
|
|
|
|
|
Hello everyone
I'm working on a large project wich involves voice command. I've made the basic things (dictation, commands hardcoded with general Grammar) however now i wanted to implement my custom grammar XML file but i keep getting an error. I've gone over almost all the tutorials and scripts i could find on the matter (2 days of nearly non-stop research). So i finaly desided to post here for help.
I'm getting the "ComException was unhandled - Exception from HRESULT: 0x80046052" error on the following code:
Grammar.CmdLoadFromFile("C:\Grammar.xml", SpeechLoadOption.SLOStatic)
Here is a scaled down version of the problem:
Imports System
Imports System.Data
Imports System.Deployment
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Xml
Imports SpeechLib
Public Class Form2
Dim WithEvents RecoContext As SpSharedRecoContext
Dim Grammar As ISpeechRecoGrammar
Private Sub initialize()
If RecoContext Is Nothing Then
RecoContext = New SpSharedRecoContext
Grammar = RecoContext.CreateGrammar(1)
Grammar.CmdLoadFromFile("c:\Grammar.xml", SpeechLoadOption.SLOStatic) 'Error here
Grammar.DictationSetState(SpeechRuleState.SGDSInactive)
Grammar.CmdSetRuleIdState(1, SpeechRuleState.SGDSActive)
End If
End Sub
Private Sub btnInit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInit.Click
initialize()
End Sub
End Class
Any help would be appreciated!
Thanks in advance
p00m
|
|
|
|
|
I admit that this is just a bit of a wild guess, but I have had some very remotely similar problems when reading from XML files.
Considering the line of code where you have the error happening, and it then claiming that it is unhandled, suggests to me that the error is not actually happening in that line of code itself, but in the code that you are calling with the CmdLoadFromFile method.
In my case, after lots of research and hair pulling, I found that it all came down to some field in the xml file containing a naughty character like / or ' or & or <, etc. These characters would throw of the xml reader, and therefore cause an error in the code that called the reader.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi,
I have created a Access Table database. In the Visual Basic 2008 Express, i have created a windows form and i put datagridview into this form. The datagridview is bind to the database.
I want to select multiple cells in the table (shown in datagridview) and then copy these multiple cells' data into a text file.
Can anybody advise me the sample code to do this? Thanks.
|
|
|
|
|
Take a look at the DataGridView.MultiSelect and/or the DataGridView.SelectMode properties.
That should help with the first part.
Then look at the DataGridView.SelectedCells property. This returns a collection of cells, all you have to do is work out how to iterate through the collection. I'll leave you to work that bit out.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi
I have built my own web browser in Visual Studio 2008, and what I would like to do is to close the browser if there is no activity.
How do you do this? Do you have to detect whether there is any key press or mouse movement, and then close?
Can someone please help me.
Thanks
|
|
|
|
|
AndyASPVB wrote: Do you have to detect whether there is any key press or mouse movement, and then close?
Yup. Put a timestamp on the last activity (meaning that each keypress and mousemove cause an update of that variable) and use the Application.Idle event to check whether there has been any activity between (Now - timestamp).
Alternatively, you could write a screensaver that simple loops all active processes and kills the browser
I are troll
|
|
|
|
|
Hi Everyone
I am looking if someone can give me some guidance.
Can someone explain to me how I can disable some hot keys, because the application I am building needs to be fairly secure. The keys I am looking to switch off are
1) Ctrl & C
2) Ctrl & X
3) Print Screen
4) Delete
They only need to be turned off for the duration of when the application is running.
How do you do this?
Thanks
|
|
|
|
|
Try taking a look at Global Windows Hooks[^]
When the corresponding key combinations are pressed, use e.Handled = True . Do read the article before using, so that you know what you're doing
Greets,
Zaegra
Motivation is the key to software development.
|
|
|
|
|
AndyASPVB wrote: 4) Delete
What's unsafe about the delete button?
I are troll
|
|
|
|
|
AndyASPVB wrote: 3) Print Screen
How are you going to deal with a screen capture utility?
What happens if someone has a custom mapped keyboard?
If someone is serious about snaffling your screens and text data, you are not going to stop them with this type of fix, you only get the casual users and annoy them into using more advanced tools if it is important to them.
Never underestimate the power of human stupidity
RAH
|
|
|
|