Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
T

tker

@tker
About
Posts
11
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to Read folder contents [modified]
    T tker

    Hi, You need to use the System.IO namespace. The following code will get you all files in a folder as strings in a string array, including the folder path: string[] files = Directory.GetFiles(@"c:\MyXMLFolder"); Everything you will need to work with files can be found in System.IO. Regards, Toby

    C# csharp sales xml tutorial

  • VSTO Outlook Addin with a winform
    T tker

    Patrick, From that list I would say you don't have the VSTO SE (v3) installed as it tells you it is VSTO SE. The project types change with each release, as do the capabilities. I am currently using purely VSTO v3 with Office 2007 so my experience with it will differ from your's. I do, however, remember using VSTO 2005 (the 2nd release) with Word 2003 when VS2005 was first released and don't think I had any trouble with Windows Forms then either... Outlook is different from Word in many regards though. I suggest you try the MSDN VSTO Forums, you'll usually find you receive answers there, generally from MVPs, quite quickly. Try http://forums.microsoft.com/msdn/showforum.aspx?forumid=16&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=0[^]

    Windows Forms debugging help question workspace

  • Help about Office word In C#
    T tker

    There are a myriad of reasons why you might get some messages. My advice is to make sure you don't have any instances of your code running anywhere as that will cause errors such as the one you mentioned and to google the errors as they arise. Toby

    C# csharp help question

  • VSTO Outlook Addin with a winform
    T tker

    Hi Patrick, I certainly show Winforms modally using .ShowDialog() from VSTO addins, but I haven't done it from Outlook - only Word, Excel and Powerpoint. Also I'm using VSTO v3 and Office 2007; I'm not sure what version you're using, but VSTO can be quite different between releases. What's happening when you run it in debug and put a breakpoint there? You really need to know what the exception being thrown is so try to trap the error so you can read it. Cheers, Toby Toby -- modified at 20:27 Wednesday 8th August, 2007

    Windows Forms debugging help question workspace

  • VSTO Outlook Addin with a winform
    T tker

    Hi Patrick, Try setting caspol on the machine you install to so your VSTO dlls have full trust permission. If they don't that will prevent them running. This is automatically set on development machines. VSTO by default suppresses error messages (though there is a setting you can type at the command line to change that - you'll have to google it, something like VSTOSUPPRESSERRORS = false, though that's wrong) so it's hard to tell what's going on - you can always put try{}catches{} around your code then display a message box or log to the event log, but often if something just doesn't happen it is a caspol issue due to the security model of the VSTO architecture. If you have any further questions please ask away. Regards, Toby Toby

    Windows Forms debugging help question workspace

  • Start form maximized [modified]
    T tker

    If you don't want to set the form to maximized at design time do it in onLoad event: this.WindowState = FormWindowState.Maximized; Toby

    Windows Forms question

  • type converting
    T tker

    string str = new string(char[] value); Toby Russell

    C# question

  • website code generator
    T tker

    Hi, This is just off the top of my head as I haven't done any web work for years, but depending on exactly how much functionality you wish to offer and what code you wish to generate, you should look at .NET CodeDOM for code generation and the use of XSLT with XML. XSLT can convert XML to HTML or XHTML markup, but it can also be used to generate C#, javascript or any other language from XML. If you got the users to make selections via your UI then stored these as XML you could easily generate code thus. I'm sorry not to provide more detail, but I think this is at least the right direction. Regards, Toby

    C# ai-coding help tutorial question

  • Help about Office word In C#
    T tker

    Hi kcynic, The code I gave you will work straight out to open word from a windows form. Changing the path can easily be done in the event that is created for the document when you open it from the form, have a play with it and you should find it easy enough. If you have more questions please feel free to ask whatever. Mark was right; Office is incredibly easily and powerfully automated and can be customised to do many things for the user. If you are really serious about Office Automation look into VSTO. It gives a fantastic, totally managed code, interface for Office development. Regards, Toby Toby Russell

    C# csharp help question

  • Interface VS Abstract classes
    T tker

    Hi Seema, Interfaces are essential when programming using Component Orientated Design as opposed to OOD. In general I tend towards using Interface inheritance as I code for components, not objects. Components are more flexible and reusable, in no small part due to the way they interact using Interfaces and thus separate interface from implementation, making reimplementation or reuse easier. Interface based inheritance means simplifies greatly the use of inheritance and polymorphism as abstract classes may implement member variables or provide virtual functions as well as abstract functions which can make the hierarchy more fragile and prone to reuse issues. If you need common functionality across a number of subclasses then an abstract class is useful; it is, however, also useful to make that abstract class implement an interface for its subclasses to use as their contract with their clients as well. A class may only implement one base class, but can implement multiple interfaces. If an interface implements another interfaces then classes that implement that interface will have to implement the methods for both. Conflicts may be resolved via explicit interface inference or by channeling both into one method (or a combination). As with abstract classes, interfaces may be Generic and decorated with attributes. Interfaces are a very useful and powerful construct. I would recommend their use heavily to achieve a component based architecture rather than an object based architecture. Toby Toby Russell

    C# question visual-studio

  • Help about Office word In C#
    T tker

    Hi, Do you wish to open the Word doc from another process? Do you wish to populate it? Would you like to automate the creation of documents, either before Word opens or by helping the user after it has opened? Basically to open Word with a new document you need to do the following: First create a new Windows Forms project. Add a button to the default form. Next add a reference to the Microsoft Office 12.0 Object Library & Microsoft Word 12.0 Object Library (for Office 2007) so you have access to the word objects. The Office 12.0 Object library is not strictly necessary, but you may find you need it to complete other operations further down the track. Next use the following as the code behind for Form1: //START CODE using System.Windows.Forms; using Word = Microsoft.Office.Interop.Word; namespace WordSample { public partial class Form1 : Form { private object m_Missing = Type.Missing; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { //create word application Word.Application word = new Word.Application(); //create word document Word.Document wordDoc = new Word.Document(); //make visible word.Visible = true; //add document to application wordDoc.Application.DocumentBeforeSave += new Microsoft.Office.Interop.Word.ApplicationEvents4_DocumentBeforeSaveEventHandler(Application_DocumentBeforeSave); wordDoc = word.Documents.Add(ref m_Missing, ref m_Missing, ref m_Missing, ref m_Missing); } void Application_DocumentBeforeSave(Microsoft.Office.Interop.Word.Document Doc, ref bool SaveAsUI, ref bool Cancel) { //PUT YOUR PATH CODE HERE; } } } //END CODE That will create a new instance of word. To modify the closing behaviour there are a number of events available to you including the Application.DocumentBeforeSave or Application.DocumentBeforeClose events. I have included a dummy ApplicationBeforeSave event for you. There is extensive documentation on MSDN regarding the Word ObjectModel that lists all events (http://msdn2.microsoft.com/en-us/library/kw65a0we(vs.80).aspx[^];

    C# csharp help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups