Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RE: Is there a way to access vba macros in infopath like in word?

62 views
Skip to first unread message

Alexandre

unread,
Aug 12, 2004, 10:01:02 AM8/12/04
to
If there isn't, how can I automate infopath from word?

For excel to word I would do this;
Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = False
Set wrdDoc = wrdApp.Documents.Open(Filepath)


but createobject doesnt seem to work with infopath. How can I do the same
thing for infopath as the above?

"Alexandre" wrote:

> There is no vba editor in my installation of infopath -or i cant find-. Can
> you write vba macros in infopath like in word. Note that the macros work
> correctly in excel, word and powerpoint.
>
> Thanks!

Ed Richard

unread,
Aug 12, 2004, 10:49:35 AM8/12/04
to
Alexandre,

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_tr/html/odc_INF_Lab_16.asp

This should get you started.

This:
Dim o
Set o = Createobject("Infopath.Application")
Msgbox o.version,,"done"


works for me...

HTH,
Ed Richard

"Alexandre" <Alex...@discussions.microsoft.com> wrote in message
news:0832BF2A-EFA4-44D1...@microsoft.com...

Alexandre

unread,
Aug 12, 2004, 11:55:02 AM8/12/04
to
I wrote the same thing you did but it returns,

Error 429: ActiveX component cannot create object.

I have office 2k3 installed (and infopath) and I reference infopath1.0
object type to my project. It works for word, excel and powerpoint, but not
for infopath. Any idea what could be wrong?

Brian Teutsch [MSFT]

unread,
Aug 12, 2004, 3:29:07 PM8/12/04
to
You'll need to be running Service Pack 1 to get external automation to work.

Brian

"Alexandre" <Alex...@discussions.microsoft.com> wrote in message

news:0A5EA374-BB91-4D41...@microsoft.com...

0 new messages