Open existing Infopath file through Excel Macro
Open existing Infopath file through Excel Macro
Open existing Infopath file through Excel Macro
Open existing Infopath file through Excel Macro
Open existing Infopath file through Excel Macro
Open existing Infopath file through Excel Macro Open existing Infopath file through Excel Macro Open existing Infopath file through Excel Macro Open existing Infopath file through Excel Macro Open existing Infopath file through Excel Macro Open existing Infopath file through Excel Macro Open existing Infopath file through Excel Macro Open existing Infopath file through Excel Macro
Open existing Infopath file through Excel Macro Open existing Infopath file through Excel Macro
Open existing Infopath file through Excel Macro
Go Back  Xtreme Visual Basic Talk > > > > Open existing Infopath file through Excel Macro


Reply
 
Thread Tools Display Modes
  #1  
Old 06-26-2015, 04:15 AM
SLKDS SLKDS is offline
Newcomer
 
Join Date: Jun 2015
Posts: 1
Default Open existing Infopath file through Excel Macro


Hi,
I am trying to Open existing InfoPath form in which I am going to add data in some field of form.

Can someone help me on this.

Thank you in advance.
Reply With Quote
  #2  
Old 06-26-2015, 11:50 AM
hDC_0Open existing Infopath file through Excel Macro hDC_0 is offline
Contributor

* Expert *
 
Join Date: Feb 2004
Posts: 559
Default VB6 and the InfoPath object model (which has changed in different versions)

Hello, SLKDS, and welcome to the form.

I noticed in your request for help:
Quote:
Originally Posted by SLKDS
I am trying to Open existing InfoPath form..
..that you didn't specify which version of InfoPath is involved.

This is important because not only has the InfoPath Object Architecture changed significantly from version 2003 to version 2013,
but according to this Wikipedia article on InfoPath, the server side components changed as well.

The InfoPath 2010 Forms Services Architecture is relatively complex.

I still have an old bookmark for "Architecture of Microsoft Office InfoPath 2003".
The closest equivalent in the current MSDN would probably be:
Understanding the InfoPath 2003 Object Model

Off of that page is the MSDN article "How to: Access Form Data Using the InfoPath 2003 Object Model",
which has an overview of the XDocumentCollection interface.

The version 2010/2013 InfoPath Open Form (using XDocuments2.Open Method) is designed around VB.Net, not VB6, though.
However there is (for InfoPath 2003) an Open Method (ExternalApplication Object).

So hopefully all of that gives some indication of how critical knowing which version of InfoPath you are working with can be to try and assist you.



As if says here (on the InfoPath Dev forum),
Quote:
I can confirm that infopath 2010 only works with managed script (C# or visual basic) no more vbscript or jscript.
This agrees with this MSDN page on "About programming InfoPath" (for InfoPath 2003), that says:
Quote:
Like other Microsoft Office applications, InfoPath provides a programming environment and programming languages
that developers can use to automate and extend their Office applications.

However, while most Office applications use Microsoft Visual Basic for Applications (VBA) as their primary programming language,
InfoPath uses two scripting languages—Microsoft JScript and Microsoft VBScript.
In addition, the programming environment that is used when writing programming code in InfoPath
is the Microsoft Script Editor (MSE), not the Visual Basic Editor.


I don't want to leave you without any code, though..

This MSDN page has the following VBA code for (at least) opening an InfoPath 2003 form:
Code:
Dim objIP As Object 
 
Set objIP = CreateObject("InfoPath.Application") 
 
' Open an existing form 
objIP.XDocuments.Open ("C:\MyFolder\MyForm.xml") 
 
' Create a new form based on a form template 
objIP.XDocuments.NewFromSolution ("C:\MyFolder\MyForm.xsn")
According to this off forum thread on "using Infopath forms with WebBrowser control and VB6",
Quote:
If you need to work with the forms then you need the xsn file, but it is encrypted.
This may be just an optional encryption for InfoPath form version 2007 and higher..
Post #15 of that thread does have a VB6 project attachment and post #19 does give a code snippet.


Sorry if that's a little "spotty" in answering your question, but if you let us know which version of InfoPath you are using,
maybe we can help with a more focused response (posting the code you tried and didn't work is always helpful as well).
Reply With Quote
Reply

Tags
infopath, macro, vba, xml


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Open existing Infopath file through Excel Macro
Open existing Infopath file through Excel Macro
Open existing Infopath file through Excel Macro Open existing Infopath file through Excel Macro
Open existing Infopath file through Excel Macro
Open existing Infopath file through Excel Macro
Open existing Infopath file through Excel Macro Open existing Infopath file through Excel Macro Open existing Infopath file through Excel Macro Open existing Infopath file through Excel Macro Open existing Infopath file through Excel Macro Open existing Infopath file through Excel Macro Open existing Infopath file through Excel Macro
Open existing Infopath file through Excel Macro
Open existing Infopath file through Excel Macro
 
Open existing Infopath file through Excel Macro
Open existing Infopath file through Excel Macro
 
-->