|
You are using the Outlook interop, not MAPI (even though you are getting the MAPI namespace). If you look at the documentation[^] for the MailItem.Send method, you will see that it says the dialog will be shown. This is a security measure, so I doubt you would be able to programmatically suppress it.
You should be able to configure the Outlook UI to suppress it though (depending on your version). I'm running Outlook 2007, and I can disable it under the "Tools->Trust Center..." menu item. In the dialog select "Programmatic Access", and select the "Never warn me..." option. This is not recommended by Microsoft or me.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
I am using Microsoft Outlook 2003, so where can i find this option.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Sorry, I don't have Outlook 2003, so you'll have to find it yourself. This[^] may help though.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi,
I'm new to programming in C#, actually learning under someone. I recently saw the following line of code in the code-behind of an ASP.NET Web application page :
//all the other autogenerated codes
static DataSet dSet; // explain this line please.
What does it mean to make a DataSet static?
Thanks for your time.
Obinna from Nigeria.
|
|
|
|
|
ObinnaAj wrote: What does it mean to make a DataSet static?
Hi, Obinna. In an ASP.NET project, this makes no difference, because of how ASP.NET works. In general, it means that if you have a class like this:
class Widget
{
public static int widgetCount = 0;
}
then the value of widgetCount is the same across all instances of the program. If the Widget constructor looked like this:
public Widget()
{
++widgetCount;
}
Then, every widget would have the same value, and it woild not be 1, it would be equal to the number of widgets that had been created. In fact, in C#, if you do this:
Widget w = new Widget();
int n = w.widgetCount;
The compiler would not allow it. You need to do this:
int n = Widget.widgetCount;
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: public Widget()
{
++widgetCount;
}
Could you tell any sample scenario where we need to use this kind of increment ? i don't find any use of incrementing the static value.
|
|
|
|
|
Well, a count of objects seemed like a decent real world example. Another may be a database connection string. Basically, if the value is always the same, or if it is a value you want to be able to make all instances aware of, static does that for you.
Once you know how it works, if you ever need it, you'll know.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: In an ASP.NET project, this makes no difference, because of how ASP.NET works.
As an ASP.NET application is multi threaded, it makes a huge difference. A static variable will be shared across all threads, so they are rarely used at all in ASP.NET applications.
If you want to have some data that is used by all threads, it's often better to put it in the Application.Items collection, and populate it from Application_Start in global.asax.
---
single minded; short sighted; long gone;
|
|
|
|
|
So, if you store something as a static variable in a page, when a new page instance gets created, that value has been stored ? I didn't think so.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: So, if you store something as a static variable in a page, when a new page instance gets created, that value has been stored ?
Yes. The static variable belong to the class rather than the class instance. The static variable exists before there are any instances.
---
single minded; short sighted; long gone;
|
|
|
|
|
So does it mean that the content of the instatiated DataSet cannot be changed anywhere in the program? what exactly?
//obinnaaj Eof
|
|
|
|
|
You can change the DataSet, but then you have to use locking for every access to it, so that one thread can't read it while another thread is changing it.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi Obinna,
Going back a bit because you're probably not familiar with multiple threading yet, the static keyword marks the variable as being shared across all instances of the class.
so for instance if you have a class member which is an int:
public class MyClass
{
int z;
}
each and every instance of that class you create (new MyClass() ) will have its own z, which can and usually will be different.
when its static:
public class MyClass
{
static int z;
}
then each and every instance shares just a single z. If you change it in one instance, it will change in all instances. As said previously, this could be useful if you wanted to maintain a count of how many instances are in existence and have that variable in class scope.
Similiarly, if you had a database connection string, that would be the same for each instance so you would mart it static so that you didn't create multiple copies of the same thing but instead just have one which each instance can access.
Regards,
Rob Philpott.
|
|
|
|
|
Hi,
I've posted this on the Microsoft forums as well but have not received any usable answer. I have a storyboard in XAML (in a DataTemplate) that I need to start from code. Now I've given up on that idea and rather went with an event to start it. Note: This is WPF.
instead of:
<code>
<Border.Triggers>
<EventTrigger RoutedEvent="Grid.MouseRightButtonDown">
<BeginStoryboard>
</code>
I now have:
<code>
<Border.Triggers>
<EventTrigger RoutedEvent="local:TouchActor.gestureMade">
<BeginStoryboard>
</code>
gestureMade is an event I created. Which is defined in code as:
<code>
public static readonly RoutedEvent gestureMadeEvent = EventManager.RegisterRoutedEvent("gestureMade", RoutingStrategy.Bubble, typeof(gestureMadeHandler), typeof(TouchActor));
public delegate void gestureMadeHandler( object sender, GestureEventArgs e );
public event gestureMadeHandler gestureMade
{
add { AddHandler(gestureMadeEvent, value); }
remove { RemoveHandler(gestureMadeEvent, value); }
}
</code>
I know the event gets raised because I have a MessageBox that pops up in the handler. The problem is that it doesn't trigger the animation. Am I missing something?
rather have something you don't need, than need something you don't have
|
|
|
|
|
WPF forums on MSDN are close to useless unless you have a week to wait, in my experience.
The way to start a storyboard in code is something like this:
BeginStoryboard storyboardShow = Resources["showAnimation"] as BeginStoryboard;
storyboardShow.Storyboard.Begin(this);
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
thanks for the reply. The problem is that the BeginStoryboard is in a Trigger, which is far nested into a DataTemplate so I cannot give it a key.
I got to the BeginStoryboard through code by navigating through the template and registering everything that I need. So when I finally call story.Storyboard.Begin(this); I get no errors, the code is run (checked via tracing through it) but the animation doesn't happen. Any reason for this? Wrong containingObject?
rather have something you don't need, than need something you don't have
|
|
|
|
|
Hello guys,
Can we call a specific part of a function?? I tried regions, code blocks, any suggestion?? Are inner classes supported in C# dont tell me "why dont you try it then" because I dont even remember using them else than event handling.
Thank you guys.
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Muammar© wrote: Are inner classes supported in C#
Yes, but how would that help ?
You can have a function that returns half way through, but it sounds like you need to break your function in to two, if it does two different things and you only want one to occur.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Hello,
I am trying to figure out a way to convert a PDF to an HTML file. I have a need to convert various different files to html files. So far the program I have written (in C#) will convert .doc and .xls to .html. The next thing I need is .pdf to .html.
The way that seems easiest is to open an instance of acrobat in the background, open the pdf, and do a saveas html file. How can I do that? Is there a reference I can import to "control" Acrobat like you can for Word and Excel?
Any help is much appreciated. Thanks!
--Shea
|
|
|
|
|
I don't believe so. There are third party controls that give you access to a PDF to varying degrees, tho.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for the response.
So far all I have found on "controlling" Acrobat is an AutoIt-script UDF (class) that has only been under development for 3 weeks or so, and has no support thus far for a "Save As".
I am surprised there is no class for this in C# already.
|
|
|
|
|
Why ? Microsoft wrote Office, they didn't write Acrobat, and when they put PDF functionality in Office, Adobe sued them, even though it's a public standard.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
What I mean is that I can't be the only person wanting to do this. I'm just surprised that some random person (Not necessarily MS or Adobe) has not created a class or something to automate Acrobat.
I'm relatively new to C# so i'm not really sure how to go about it, or i'd take a stab at it myself.
Creating a class to do whatever using the Office PIA's was easy, but without a handy PIA for Adobe, i'm lost...
|
|
|
|
|
Many moons ago, when I had no programming tools bar a copy of VBA hosted in Excel I had a similar quandry. With no budget to speak of, the fools I worked for wanted to do exactly the same...
...What I ended up doing was a whole bunch of crappy/hacky things such as using SendKeys to control Acrobat. It's a cruddy solution, but it works. After a fashion. I just had to put a big warning in place that said "DO NOT TOUCH THE KEYBOARD OR MOUSE WHILST THIS PROGRAM IS RUNNING". As far as I know, some sap still spends most of his days looking at that warning.
Me: Can you see the "up" arrow?
User:Errr...ummm....no.
Me: Can you see an arrow that points upwards?
User: Oh yes, I see it now!
-Excerpt from a support call taken by me, 08/31/2007
|
|
|
|