Can anyone help?
I have an InfoPath form that has a submit button. The submit button sends
the form to an email address. When a user clicks on the form via the email, I
would like them to see a different view (this view is already within the
form).
I have been looking at the OnLoad Event, which I have placed code that
changes the view (so this bit works !!). What I need is to identify the form
via an If statement, which would wrap around the switching view line, but am
having problems as I use VBA/VB.Net so am unfamiliar with the object module.
Many thanks
GaryU - 02 Nov 2006 15:17 GMT
Actually, I'm interested in this as well, I have similar problems. Can
anyone help here?
Thanks,
Gary
> Can anyone help?
>
[quoted text clipped - 9 lines]
>
> Many thanks
Maui Williams - 02 Nov 2006 20:36 GMT
I wouldn't know how to do this unless I knew the name of the form before
I submitted the form to the email.
Maui Williams | Solution Developer II, MCSD.Net
Avanade | West Region
2211 Elliott Avenue, Suite 200 Seattle, WA 98121
-----Original Message-----
From: Jackie [mailto:Jackie@discussions.microsoft.com]
Posted At: Wednesday, November 01, 2006 8:42 AM
Posted To: microsoft.public.infopath
Conversation: Identifying name of document
Subject: Identifying name of document
Can anyone help?
I have an InfoPath form that has a submit button. The submit button
sends
the form to an email address. When a user clicks on the form via the
email, I
would like them to see a different view (this view is already within the
form).
I have been looking at the OnLoad Event, which I have placed code that
changes the view (so this bit works !!). What I need is to identify the
form
via an If statement, which would wrap around the switching view line,
but am
having problems as I use VBA/VB.Net so am unfamiliar with the object
module.
Many thanks
Russ - 02 Nov 2006 20:45 GMT
I don't know if this is what you are looking for (or if it would work), but
you could try including a hidden "emailed" field in your form somewhere, and
set it to true when the form is emailed. Then you can put a check in your
onLoad event to see if the "emailed" field is true, and set the view
accordingly.
> I wouldn't know how to do this unless I knew the name of the form before
> I submitted the form to the email.
[quoted text clipped - 29 lines]
>
> Many thanks
Jackie - 07 Nov 2006 11:34 GMT
Thanks for the suggestion Russ. Have put this in place, forcing the user to
click on a checkbox, but I still seem to be having problems. The code is
below:
var strValue
strValue = XDocument.DOM.selectSingleNode"//my:Change/my:ChangeSubmit").text
XDocument.UI.Alert(strValue)
if (strValue.text = "false")
XDocument.ViewInfos("Main View").IsDefault = true;
if (strValue.text = "true")
XDocument.ViewInfos("TUG View").IsDefault = true;
The value (strValue) is correct and is giving me a true or false text value
via the alert. The problem I am having is that the "If" statement is not
recognising the value.
Any suggestions greatly appreciated.
Many thanks
Jackie
> I don't know if this is what you are looking for (or if it would work), but
> you could try including a hidden "emailed" field in your form somewhere, and
[quoted text clipped - 35 lines]
> >
> > Many thanks
Russ - 07 Nov 2006 15:49 GMT
It looks like your problem is that you are referring to the strValue variable
as if it were storing a node. Since you have the line:
strValue = XDocument.DOM.selectSingleNode"//my:Change/my:ChangeSubmit").text
strValue is storing a string, so you don't need to access it with
strValue.text
A simple
if (strValue == "false") { code } else { more code }
would work fine.
(make sure to use == for comparison)
> Thanks for the suggestion Russ. Have put this in place, forcing the user to
> click on a checkbox, but I still seem to be having problems. The code is
[quoted text clipped - 59 lines]
> > >
> > > Many thanks
Jackie - 08 Nov 2006 08:48 GMT
Many thanks Russ ... it works like a charm.
> It looks like your problem is that you are referring to the strValue variable
> as if it were storing a node. Since you have the line:
[quoted text clipped - 71 lines]
> > > >
> > > > Many thanks