open a document with C# - InfoPath Dev
in

InfoPath Dev

open a document with C#

Last post 06-14-2010 09:01 AM by Hilary Stoupa. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 06-12-2010 03:00 PM

    • Lawson
    • Top 100 Contributor
    • Joined on 12-24-2009
    • Virginia
    • Posts 91

    open a document with C#

    I have an IP 2003 form with C# code.

    I would like to code a button that will open a document when it is pressed.

    Does anybody know how to do this with C# code?

     Thanks,

    -Lawson

  • 06-12-2010 03:17 PM In reply to

    • Lawson
    • Top 100 Contributor
    • Joined on 12-24-2009
    • Virginia
    • Posts 91

    Re: open a document with C#

    I am using the following code:

    this.Application.Documents.Open(@"C:\Users\Lawson\Documents\Test.docx");

    But I keep getting the following error:

    Error 1 'Form_Creator_A.FormCode' does not contain a definition for 'Application' C:\Users\Lawson\Documents\InfoPath Projects\Form Creator A1\FormCode.cs 543 18 Form Creator A

  • 06-12-2010 08:18 PM In reply to

    Re: open a document with C#

    Hey there, Lawson! Here's an article that may help you get started opening a Word document with .NET code.

    Hilary Stoupa

  • 06-12-2010 11:41 PM In reply to

    • Lawson
    • Top 100 Contributor
    • Joined on 12-24-2009
    • Virginia
    • Posts 91

    Re: open a document with C#

    Hey hilary, this is great. You're awesome 8^ )

    I aslo want to create a button that will open a video file in Windows Media Player.

    Can you point me in the right direction on this subject as well?

     Thanks,

    -Lawson

  • 06-14-2010 09:01 AM In reply to

    Re: open a document with C#

    Check out this, it looks like it may have enough info to get you started... have fun!

    Hilary Stoupa

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.