Group:  Microsoft Word ยป microsoft.public.word.vba.userforms
Thread: Sending completed User Forms...

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Sending completed User Forms...
mptc 25.09.2006 22:37:02
I have designed a User Form. It is a Print Shop Requisition with various
fields to order a printing job from the In-Plant Print Shop. My hope is to
have departments fill out the form and click the Submit button at the bottom
of the completed form and have it emailed back to me as an attached completed
form. I have designed this type of form before, but it has been a long time.
I am trying to code the "Submit" button but am having problems. I have
copied and pasted the code from the previous form and made the changes in the
form name. When I run the debug I get this error....User-defined type not
defined. The line of code that it highlighted is the "Dim oOutlookApp As
Outlook.Application".

Can anyone help me figure this one out. Thank you in advance for your input.

mptc
Re: Sending completed User Forms...
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 26.09.2006 03:50:40
In the Visual Basic Editor, you need to select References from the Tools
menu and set a reference to the Outlook Object Library.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
news:E09F6D49-1248-4A3B-8B59-9EA7639AA3E2[ at ]microsoft.com...
[Quoted Text]
>I have designed a User Form. It is a Print Shop Requisition with various
> fields to order a printing job from the In-Plant Print Shop. My hope is
> to
> have departments fill out the form and click the Submit button at the
> bottom
> of the completed form and have it emailed back to me as an attached
> completed
> form. I have designed this type of form before, but it has been a long
> time.
> I am trying to code the "Submit" button but am having problems. I have
> copied and pasted the code from the previous form and made the changes in
> the
> form name. When I run the debug I get this error....User-defined type not
> defined. The line of code that it highlighted is the "Dim oOutlookApp As
> Outlook.Application".
>
> Can anyone help me figure this one out. Thank you in advance for your
> input.
>
> mptc


Re: Sending completed User Forms...
mptc 26.09.2006 16:35:01
Thanks Doug, that did it! However, I have a follow up issue. After
completing the form and hitting the submit button, I don't want the form to
save the comments etc. IOW I want the form to revert back to the blank form.
I will receive the completed form via email, but the original form I want to
revert back to the blank form. I can save the submitted form and the
individual departments can always save their completed form at their end. Is
there a code I am missing?

Thanks!

Mike

"Doug Robbins - Word MVP" wrote:

[Quoted Text]
> In the Visual Basic Editor, you need to select References from the Tools
> menu and set a reference to the Outlook Object Library.
>
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> news:E09F6D49-1248-4A3B-8B59-9EA7639AA3E2[ at ]microsoft.com...
> >I have designed a User Form. It is a Print Shop Requisition with various
> > fields to order a printing job from the In-Plant Print Shop. My hope is
> > to
> > have departments fill out the form and click the Submit button at the
> > bottom
> > of the completed form and have it emailed back to me as an attached
> > completed
> > form. I have designed this type of form before, but it has been a long
> > time.
> > I am trying to code the "Submit" button but am having problems. I have
> > copied and pasted the code from the previous form and made the changes in
> > the
> > form name. When I run the debug I get this error....User-defined type not
> > defined. The line of code that it highlighted is the "Dim oOutlookApp As
> > Outlook.Application".
> >
> > Can anyone help me figure this one out. Thank you in advance for your
> > input.
> >
> > mptc
>
>
>
Re: Sending completed User Forms...
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 26.09.2006 17:20:13
Is this actually a userform or do you have controls directly in the
document?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
news:C053C9DD-B23D-4AD0-B98D-76F70C623436[ at ]microsoft.com...
[Quoted Text]
> Thanks Doug, that did it! However, I have a follow up issue. After
> completing the form and hitting the submit button, I don't want the form
> to
> save the comments etc. IOW I want the form to revert back to the blank
> form.
> I will receive the completed form via email, but the original form I want
> to
> revert back to the blank form. I can save the submitted form and the
> individual departments can always save their completed form at their end.
> Is
> there a code I am missing?
>
> Thanks!
>
> Mike
>
> "Doug Robbins - Word MVP" wrote:
>
>> In the Visual Basic Editor, you need to select References from the Tools
>> menu and set a reference to the Outlook Object Library.
>>
>> --
>> Hope this helps.
>>
>> Please reply to the newsgroup unless you wish to avail yourself of my
>> services on a paid consulting basis.
>>
>> Doug Robbins - Word MVP
>>
>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>> news:E09F6D49-1248-4A3B-8B59-9EA7639AA3E2[ at ]microsoft.com...
>> >I have designed a User Form. It is a Print Shop Requisition with
>> >various
>> > fields to order a printing job from the In-Plant Print Shop. My hope
>> > is
>> > to
>> > have departments fill out the form and click the Submit button at the
>> > bottom
>> > of the completed form and have it emailed back to me as an attached
>> > completed
>> > form. I have designed this type of form before, but it has been a long
>> > time.
>> > I am trying to code the "Submit" button but am having problems. I have
>> > copied and pasted the code from the previous form and made the changes
>> > in
>> > the
>> > form name. When I run the debug I get this error....User-defined type
>> > not
>> > defined. The line of code that it highlighted is the "Dim oOutlookApp
>> > As
>> > Outlook.Application".
>> >
>> > Can anyone help me figure this one out. Thank you in advance for your
>> > input.
>> >
>> > mptc
>>
>>
>>


Re: Sending completed User Forms...
mptc 26.09.2006 17:33:02
I thought it was called a user form. It has text boxes, option buttons and
check boxes within the form. I used the Visual Basic tools.

Mike

"Doug Robbins - Word MVP" wrote:

[Quoted Text]
> Is this actually a userform or do you have controls directly in the
> document?
>
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> news:C053C9DD-B23D-4AD0-B98D-76F70C623436[ at ]microsoft.com...
> > Thanks Doug, that did it! However, I have a follow up issue. After
> > completing the form and hitting the submit button, I don't want the form
> > to
> > save the comments etc. IOW I want the form to revert back to the blank
> > form.
> > I will receive the completed form via email, but the original form I want
> > to
> > revert back to the blank form. I can save the submitted form and the
> > individual departments can always save their completed form at their end.
> > Is
> > there a code I am missing?
> >
> > Thanks!
> >
> > Mike
> >
> > "Doug Robbins - Word MVP" wrote:
> >
> >> In the Visual Basic Editor, you need to select References from the Tools
> >> menu and set a reference to the Outlook Object Library.
> >>
> >> --
> >> Hope this helps.
> >>
> >> Please reply to the newsgroup unless you wish to avail yourself of my
> >> services on a paid consulting basis.
> >>
> >> Doug Robbins - Word MVP
> >>
> >> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> >> news:E09F6D49-1248-4A3B-8B59-9EA7639AA3E2[ at ]microsoft.com...
> >> >I have designed a User Form. It is a Print Shop Requisition with
> >> >various
> >> > fields to order a printing job from the In-Plant Print Shop. My hope
> >> > is
> >> > to
> >> > have departments fill out the form and click the Submit button at the
> >> > bottom
> >> > of the completed form and have it emailed back to me as an attached
> >> > completed
> >> > form. I have designed this type of form before, but it has been a long
> >> > time.
> >> > I am trying to code the "Submit" button but am having problems. I have
> >> > copied and pasted the code from the previous form and made the changes
> >> > in
> >> > the
> >> > form name. When I run the debug I get this error....User-defined type
> >> > not
> >> > defined. The line of code that it highlighted is the "Dim oOutlookApp
> >> > As
> >> > Outlook.Application".
> >> >
> >> > Can anyone help me figure this one out. Thank you in advance for your
> >> > input.
> >> >
> >> > mptc
> >>
> >>
> >>
>
>
>
Re: Sending completed User Forms...
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 27.09.2006 03:42:35
I guess by "within the form", you mean "within the document". I have no
experience with the use of such controls directly in a document, but I would
suspect that the procedure is just the same. You need to add some code
after that which emails the document to reference each textbox control on
the form and set its value or text property to "" For the checkboxes, you
would set their value to 0

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
news:B2A3D30F-9D58-4D49-BA06-C705471EC9AD[ at ]microsoft.com...
[Quoted Text]
>I thought it was called a user form. It has text boxes, option buttons and
> check boxes within the form. I used the Visual Basic tools.
>
> Mike
>
> "Doug Robbins - Word MVP" wrote:
>
>> Is this actually a userform or do you have controls directly in the
>> document?
>>
>> --
>> Hope this helps.
>>
>> Please reply to the newsgroup unless you wish to avail yourself of my
>> services on a paid consulting basis.
>>
>> Doug Robbins - Word MVP
>>
>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>> news:C053C9DD-B23D-4AD0-B98D-76F70C623436[ at ]microsoft.com...
>> > Thanks Doug, that did it! However, I have a follow up issue. After
>> > completing the form and hitting the submit button, I don't want the
>> > form
>> > to
>> > save the comments etc. IOW I want the form to revert back to the blank
>> > form.
>> > I will receive the completed form via email, but the original form I
>> > want
>> > to
>> > revert back to the blank form. I can save the submitted form and the
>> > individual departments can always save their completed form at their
>> > end.
>> > Is
>> > there a code I am missing?
>> >
>> > Thanks!
>> >
>> > Mike
>> >
>> > "Doug Robbins - Word MVP" wrote:
>> >
>> >> In the Visual Basic Editor, you need to select References from the
>> >> Tools
>> >> menu and set a reference to the Outlook Object Library.
>> >>
>> >> --
>> >> Hope this helps.
>> >>
>> >> Please reply to the newsgroup unless you wish to avail yourself of my
>> >> services on a paid consulting basis.
>> >>
>> >> Doug Robbins - Word MVP
>> >>
>> >> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>> >> news:E09F6D49-1248-4A3B-8B59-9EA7639AA3E2[ at ]microsoft.com...
>> >> >I have designed a User Form. It is a Print Shop Requisition with
>> >> >various
>> >> > fields to order a printing job from the In-Plant Print Shop. My
>> >> > hope
>> >> > is
>> >> > to
>> >> > have departments fill out the form and click the Submit button at
>> >> > the
>> >> > bottom
>> >> > of the completed form and have it emailed back to me as an attached
>> >> > completed
>> >> > form. I have designed this type of form before, but it has been a
>> >> > long
>> >> > time.
>> >> > I am trying to code the "Submit" button but am having problems. I
>> >> > have
>> >> > copied and pasted the code from the previous form and made the
>> >> > changes
>> >> > in
>> >> > the
>> >> > form name. When I run the debug I get this error....User-defined
>> >> > type
>> >> > not
>> >> > defined. The line of code that it highlighted is the "Dim
>> >> > oOutlookApp
>> >> > As
>> >> > Outlook.Application".
>> >> >
>> >> > Can anyone help me figure this one out. Thank you in advance for
>> >> > your
>> >> > input.
>> >> >
>> >> > mptc
>> >>
>> >>
>> >>
>>
>>
>>


Re: Sending completed User Forms...
mptc 27.09.2006 22:32:02
Doug:

Thanks for the tip, I tried several different codes but none worked the way
I want. I guess what gave rise to this was the fact that in testing the form
I filled out various fields and hit the "Submit" button and that worked as
planned (sending the completed form to me via email as an attachment). After
that when I hit File > Close, Word did not prompt me as to whether I wanted
to save the document or not. It just closed and automatically saved the form
with the filled in fields.

Why isn't Word prompting me as it usually does when Closing? Is there an
existing code that I need to change?

Thanks in advance.

Mike

"Doug Robbins - Word MVP" wrote:

[Quoted Text]
> I guess by "within the form", you mean "within the document". I have no
> experience with the use of such controls directly in a document, but I would
> suspect that the procedure is just the same. You need to add some code
> after that which emails the document to reference each textbox control on
> the form and set its value or text property to "" For the checkboxes, you
> would set their value to 0
>
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> news:B2A3D30F-9D58-4D49-BA06-C705471EC9AD[ at ]microsoft.com...
> >I thought it was called a user form. It has text boxes, option buttons and
> > check boxes within the form. I used the Visual Basic tools.
> >
> > Mike
> >
> > "Doug Robbins - Word MVP" wrote:
> >
> >> Is this actually a userform or do you have controls directly in the
> >> document?
> >>
> >> --
> >> Hope this helps.
> >>
> >> Please reply to the newsgroup unless you wish to avail yourself of my
> >> services on a paid consulting basis.
> >>
> >> Doug Robbins - Word MVP
> >>
> >> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> >> news:C053C9DD-B23D-4AD0-B98D-76F70C623436[ at ]microsoft.com...
> >> > Thanks Doug, that did it! However, I have a follow up issue. After
> >> > completing the form and hitting the submit button, I don't want the
> >> > form
> >> > to
> >> > save the comments etc. IOW I want the form to revert back to the blank
> >> > form.
> >> > I will receive the completed form via email, but the original form I
> >> > want
> >> > to
> >> > revert back to the blank form. I can save the submitted form and the
> >> > individual departments can always save their completed form at their
> >> > end.
> >> > Is
> >> > there a code I am missing?
> >> >
> >> > Thanks!
> >> >
> >> > Mike
> >> >
> >> > "Doug Robbins - Word MVP" wrote:
> >> >
> >> >> In the Visual Basic Editor, you need to select References from the
> >> >> Tools
> >> >> menu and set a reference to the Outlook Object Library.
> >> >>
> >> >> --
> >> >> Hope this helps.
> >> >>
> >> >> Please reply to the newsgroup unless you wish to avail yourself of my
> >> >> services on a paid consulting basis.
> >> >>
> >> >> Doug Robbins - Word MVP
> >> >>
> >> >> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> >> >> news:E09F6D49-1248-4A3B-8B59-9EA7639AA3E2[ at ]microsoft.com...
> >> >> >I have designed a User Form. It is a Print Shop Requisition with
> >> >> >various
> >> >> > fields to order a printing job from the In-Plant Print Shop. My
> >> >> > hope
> >> >> > is
> >> >> > to
> >> >> > have departments fill out the form and click the Submit button at
> >> >> > the
> >> >> > bottom
> >> >> > of the completed form and have it emailed back to me as an attached
> >> >> > completed
> >> >> > form. I have designed this type of form before, but it has been a
> >> >> > long
> >> >> > time.
> >> >> > I am trying to code the "Submit" button but am having problems. I
> >> >> > have
> >> >> > copied and pasted the code from the previous form and made the
> >> >> > changes
> >> >> > in
> >> >> > the
> >> >> > form name. When I run the debug I get this error....User-defined
> >> >> > type
> >> >> > not
> >> >> > defined. The line of code that it highlighted is the "Dim
> >> >> > oOutlookApp
> >> >> > As
> >> >> > Outlook.Application".
> >> >> >
> >> >> > Can anyone help me figure this one out. Thank you in advance for
> >> >> > your
> >> >> > input.
> >> >> >
> >> >> > mptc
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>
Re: Sending completed User Forms...
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 28.09.2006 03:45:57
Show us the code that you are using.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
news:E36556F9-AB39-442F-9834-DBDD0D3C02E6[ at ]microsoft.com...
[Quoted Text]
> Doug:
>
> Thanks for the tip, I tried several different codes but none worked the
> way
> I want. I guess what gave rise to this was the fact that in testing the
> form
> I filled out various fields and hit the "Submit" button and that worked as
> planned (sending the completed form to me via email as an attachment).
> After
> that when I hit File > Close, Word did not prompt me as to whether I
> wanted
> to save the document or not. It just closed and automatically saved the
> form
> with the filled in fields.
>
> Why isn't Word prompting me as it usually does when Closing? Is there an
> existing code that I need to change?
>
> Thanks in advance.
>
> Mike
>
> "Doug Robbins - Word MVP" wrote:
>
>> I guess by "within the form", you mean "within the document". I have no
>> experience with the use of such controls directly in a document, but I
>> would
>> suspect that the procedure is just the same. You need to add some code
>> after that which emails the document to reference each textbox control on
>> the form and set its value or text property to "" For the checkboxes,
>> you
>> would set their value to 0
>>
>> --
>> Hope this helps.
>>
>> Please reply to the newsgroup unless you wish to avail yourself of my
>> services on a paid consulting basis.
>>
>> Doug Robbins - Word MVP
>>
>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>> news:B2A3D30F-9D58-4D49-BA06-C705471EC9AD[ at ]microsoft.com...
>> >I thought it was called a user form. It has text boxes, option buttons
>> >and
>> > check boxes within the form. I used the Visual Basic tools.
>> >
>> > Mike
>> >
>> > "Doug Robbins - Word MVP" wrote:
>> >
>> >> Is this actually a userform or do you have controls directly in the
>> >> document?
>> >>
>> >> --
>> >> Hope this helps.
>> >>
>> >> Please reply to the newsgroup unless you wish to avail yourself of my
>> >> services on a paid consulting basis.
>> >>
>> >> Doug Robbins - Word MVP
>> >>
>> >> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>> >> news:C053C9DD-B23D-4AD0-B98D-76F70C623436[ at ]microsoft.com...
>> >> > Thanks Doug, that did it! However, I have a follow up issue. After
>> >> > completing the form and hitting the submit button, I don't want the
>> >> > form
>> >> > to
>> >> > save the comments etc. IOW I want the form to revert back to the
>> >> > blank
>> >> > form.
>> >> > I will receive the completed form via email, but the original form I
>> >> > want
>> >> > to
>> >> > revert back to the blank form. I can save the submitted form and
>> >> > the
>> >> > individual departments can always save their completed form at their
>> >> > end.
>> >> > Is
>> >> > there a code I am missing?
>> >> >
>> >> > Thanks!
>> >> >
>> >> > Mike
>> >> >
>> >> > "Doug Robbins - Word MVP" wrote:
>> >> >
>> >> >> In the Visual Basic Editor, you need to select References from the
>> >> >> Tools
>> >> >> menu and set a reference to the Outlook Object Library.
>> >> >>
>> >> >> --
>> >> >> Hope this helps.
>> >> >>
>> >> >> Please reply to the newsgroup unless you wish to avail yourself of
>> >> >> my
>> >> >> services on a paid consulting basis.
>> >> >>
>> >> >> Doug Robbins - Word MVP
>> >> >>
>> >> >> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>> >> >> news:E09F6D49-1248-4A3B-8B59-9EA7639AA3E2[ at ]microsoft.com...
>> >> >> >I have designed a User Form. It is a Print Shop Requisition with
>> >> >> >various
>> >> >> > fields to order a printing job from the In-Plant Print Shop. My
>> >> >> > hope
>> >> >> > is
>> >> >> > to
>> >> >> > have departments fill out the form and click the Submit button at
>> >> >> > the
>> >> >> > bottom
>> >> >> > of the completed form and have it emailed back to me as an
>> >> >> > attached
>> >> >> > completed
>> >> >> > form. I have designed this type of form before, but it has been
>> >> >> > a
>> >> >> > long
>> >> >> > time.
>> >> >> > I am trying to code the "Submit" button but am having problems.
>> >> >> > I
>> >> >> > have
>> >> >> > copied and pasted the code from the previous form and made the
>> >> >> > changes
>> >> >> > in
>> >> >> > the
>> >> >> > form name. When I run the debug I get this error....User-defined
>> >> >> > type
>> >> >> > not
>> >> >> > defined. The line of code that it highlighted is the "Dim
>> >> >> > oOutlookApp
>> >> >> > As
>> >> >> > Outlook.Application".
>> >> >> >
>> >> >> > Can anyone help me figure this one out. Thank you in advance for
>> >> >> > your
>> >> >> > input.
>> >> >> >
>> >> >> > mptc
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>


Re: Sending completed User Forms...
mptc 28.09.2006 14:16:01
Below is the code I am using to send the form via email.

Thanks for your continued help.

Mike

Private Sub Submit_Click()

Dim bStarted As Boolean
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem

On Error Resume Next

ActiveDocument.Save

Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If

Set oItem = oOutlookApp.CreateItem(olMailItem)

With oItem
.To = "mcloghessy[ at ]xanterra.com"
.Subject = "Print Shop Requisition"
'Add the document as an attachment, you can use the .displaynameproperty
'to set the description that's used in the message
.Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue, _
DisplayName:="Print Shop Requisition"
.Send
End With

If bStarted Then
oOutlookApp.quit
End If

Set oItem = Nothing
Set oOutlookApp = Nothing


End Function



"Doug Robbins - Word MVP" wrote:

[Quoted Text]
> Show us the code that you are using.
>
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> news:E36556F9-AB39-442F-9834-DBDD0D3C02E6[ at ]microsoft.com...
> > Doug:
> >
> > Thanks for the tip, I tried several different codes but none worked the
> > way
> > I want. I guess what gave rise to this was the fact that in testing the
> > form
> > I filled out various fields and hit the "Submit" button and that worked as
> > planned (sending the completed form to me via email as an attachment).
> > After
> > that when I hit File > Close, Word did not prompt me as to whether I
> > wanted
> > to save the document or not. It just closed and automatically saved the
> > form
> > with the filled in fields.
> >
> > Why isn't Word prompting me as it usually does when Closing? Is there an
> > existing code that I need to change?
> >
> > Thanks in advance.
> >
> > Mike
> >
> > "Doug Robbins - Word MVP" wrote:
> >
> >> I guess by "within the form", you mean "within the document". I have no
> >> experience with the use of such controls directly in a document, but I
> >> would
> >> suspect that the procedure is just the same. You need to add some code
> >> after that which emails the document to reference each textbox control on
> >> the form and set its value or text property to "" For the checkboxes,
> >> you
> >> would set their value to 0
> >>
> >> --
> >> Hope this helps.
> >>
> >> Please reply to the newsgroup unless you wish to avail yourself of my
> >> services on a paid consulting basis.
> >>
> >> Doug Robbins - Word MVP
> >>
> >> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> >> news:B2A3D30F-9D58-4D49-BA06-C705471EC9AD[ at ]microsoft.com...
> >> >I thought it was called a user form. It has text boxes, option buttons
> >> >and
> >> > check boxes within the form. I used the Visual Basic tools.
> >> >
> >> > Mike
> >> >
> >> > "Doug Robbins - Word MVP" wrote:
> >> >
> >> >> Is this actually a userform or do you have controls directly in the
> >> >> document?
> >> >>
> >> >> --
> >> >> Hope this helps.
> >> >>
> >> >> Please reply to the newsgroup unless you wish to avail yourself of my
> >> >> services on a paid consulting basis.
> >> >>
> >> >> Doug Robbins - Word MVP
> >> >>
> >> >> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> >> >> news:C053C9DD-B23D-4AD0-B98D-76F70C623436[ at ]microsoft.com...
> >> >> > Thanks Doug, that did it! However, I have a follow up issue. After
> >> >> > completing the form and hitting the submit button, I don't want the
> >> >> > form
> >> >> > to
> >> >> > save the comments etc. IOW I want the form to revert back to the
> >> >> > blank
> >> >> > form.
> >> >> > I will receive the completed form via email, but the original form I
> >> >> > want
> >> >> > to
> >> >> > revert back to the blank form. I can save the submitted form and
> >> >> > the
> >> >> > individual departments can always save their completed form at their
> >> >> > end.
> >> >> > Is
> >> >> > there a code I am missing?
> >> >> >
> >> >> > Thanks!
> >> >> >
> >> >> > Mike
> >> >> >
> >> >> > "Doug Robbins - Word MVP" wrote:
> >> >> >
> >> >> >> In the Visual Basic Editor, you need to select References from the
> >> >> >> Tools
> >> >> >> menu and set a reference to the Outlook Object Library.
> >> >> >>
> >> >> >> --
> >> >> >> Hope this helps.
> >> >> >>
> >> >> >> Please reply to the newsgroup unless you wish to avail yourself of
> >> >> >> my
> >> >> >> services on a paid consulting basis.
> >> >> >>
> >> >> >> Doug Robbins - Word MVP
> >> >> >>
> >> >> >> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> >> >> >> news:E09F6D49-1248-4A3B-8B59-9EA7639AA3E2[ at ]microsoft.com...
> >> >> >> >I have designed a User Form. It is a Print Shop Requisition with
> >> >> >> >various
> >> >> >> > fields to order a printing job from the In-Plant Print Shop. My
> >> >> >> > hope
> >> >> >> > is
> >> >> >> > to
> >> >> >> > have departments fill out the form and click the Submit button at
> >> >> >> > the
> >> >> >> > bottom
> >> >> >> > of the completed form and have it emailed back to me as an
> >> >> >> > attached
> >> >> >> > completed
> >> >> >> > form. I have designed this type of form before, but it has been
> >> >> >> > a
> >> >> >> > long
> >> >> >> > time.
> >> >> >> > I am trying to code the "Submit" button but am having problems.
> >> >> >> > I
> >> >> >> > have
> >> >> >> > copied and pasted the code from the previous form and made the
> >> >> >> > changes
> >> >> >> > in
> >> >> >> > the
> >> >> >> > form name. When I run the debug I get this error....User-defined
> >> >> >> > type
> >> >> >> > not
> >> >> >> > defined. The line of code that it highlighted is the "Dim
> >> >> >> > oOutlookApp
> >> >> >> > As
> >> >> >> > Outlook.Application".
> >> >> >> >
> >> >> >> > Can anyone help me figure this one out. Thank you in advance for
> >> >> >> > your
> >> >> >> > input.
> >> >> >> >
> >> >> >> > mptc
> >> >> >>
> >> >> >>
> >> >> >>
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>
Re: Sending completed User Forms...
Russ <drsN0SPAMmikle[ at ]hotmailD0Tcom.INVALID> 28.09.2006 17:02:12



Mitch,

[Quoted Text]
> Below is the code I am using to send the form via email.
>
> Thanks for your continued help.
>
> Mike
>
> Private Sub Submit_Click()
>
> Dim bStarted As Boolean
> Dim oOutlookApp As Outlook.Application
> Dim oItem As Outlook.MailItem
>
> On Error Resume Next
>
> ActiveDocument.Save

Read about the .Save and .SaveAs methods in VBA help and alter the above
line accordingly using the options you want.
>
> Set oOutlookApp = GetObject(, "Outlook.Application")
> If Err <> 0 Then
> Set oOutlookApp = CreateObject("Outlook.Application")
> bStarted = True
> End If
>
> Set oItem = oOutlookApp.CreateItem(olMailItem)
>
> With oItem
> .To = "mcloghessy[ at ]xanterra.com"
> .Subject = "Print Shop Requisition"
> 'Add the document as an attachment, you can use the .displaynameproperty
> 'to set the description that's used in the message
> .Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue, _
> DisplayName:="Print Shop Requisition"
> .Send
> End With
>
> If bStarted Then
> oOutlookApp.quit
> End If
>
> Set oItem = Nothing
> Set oOutlookApp = Nothing
>
>
> End Function
>
>
>
> "Doug Robbins - Word MVP" wrote:
>
>> Show us the code that you are using.
>>
>> --
>> Hope this helps.
>>
>> Please reply to the newsgroup unless you wish to avail yourself of my
>> services on a paid consulting basis.
>>
>> Doug Robbins - Word MVP
>>
>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>> news:E36556F9-AB39-442F-9834-DBDD0D3C02E6[ at ]microsoft.com...
>>> Doug:
>>>
>>> Thanks for the tip, I tried several different codes but none worked the
>>> way
>>> I want. I guess what gave rise to this was the fact that in testing the
>>> form
>>> I filled out various fields and hit the "Submit" button and that worked as
>>> planned (sending the completed form to me via email as an attachment).
>>> After
>>> that when I hit File > Close, Word did not prompt me as to whether I
>>> wanted
>>> to save the document or not. It just closed and automatically saved the
>>> form
>>> with the filled in fields.
>>>
>>> Why isn't Word prompting me as it usually does when Closing? Is there an
>>> existing code that I need to change?
>>>
>>> Thanks in advance.
>>>
>>> Mike
>>>
>>> "Doug Robbins - Word MVP" wrote:
>>>
>>>> I guess by "within the form", you mean "within the document". I have no
>>>> experience with the use of such controls directly in a document, but I
>>>> would
>>>> suspect that the procedure is just the same. You need to add some code
>>>> after that which emails the document to reference each textbox control on
>>>> the form and set its value or text property to "" For the checkboxes,
>>>> you
>>>> would set their value to 0
>>>>
>>>> --
>>>> Hope this helps.
>>>>
>>>> Please reply to the newsgroup unless you wish to avail yourself of my
>>>> services on a paid consulting basis.
>>>>
>>>> Doug Robbins - Word MVP
>>>>
>>>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>>>> news:B2A3D30F-9D58-4D49-BA06-C705471EC9AD[ at ]microsoft.com...
>>>>> I thought it was called a user form. It has text boxes, option buttons
>>>>> and
>>>>> check boxes within the form. I used the Visual Basic tools.
>>>>>
>>>>> Mike
>>>>>
>>>>> "Doug Robbins - Word MVP" wrote:
>>>>>
>>>>>> Is this actually a userform or do you have controls directly in the
>>>>>> document?
>>>>>>
>>>>>> --
>>>>>> Hope this helps.
>>>>>>
>>>>>> Please reply to the newsgroup unless you wish to avail yourself of my
>>>>>> services on a paid consulting basis.
>>>>>>
>>>>>> Doug Robbins - Word MVP
>>>>>>
>>>>>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>>>>>> news:C053C9DD-B23D-4AD0-B98D-76F70C623436[ at ]microsoft.com...
>>>>>>> Thanks Doug, that did it! However, I have a follow up issue. After
>>>>>>> completing the form and hitting the submit button, I don't want the
>>>>>>> form
>>>>>>> to
>>>>>>> save the comments etc. IOW I want the form to revert back to the
>>>>>>> blank
>>>>>>> form.
>>>>>>> I will receive the completed form via email, but the original form I
>>>>>>> want
>>>>>>> to
>>>>>>> revert back to the blank form. I can save the submitted form and
>>>>>>> the
>>>>>>> individual departments can always save their completed form at their
>>>>>>> end.
>>>>>>> Is
>>>>>>> there a code I am missing?
>>>>>>>
>>>>>>> Thanks!
>>>>>>>
>>>>>>> Mike
>>>>>>>
>>>>>>> "Doug Robbins - Word MVP" wrote:
>>>>>>>
>>>>>>>> In the Visual Basic Editor, you need to select References from the
>>>>>>>> Tools
>>>>>>>> menu and set a reference to the Outlook Object Library.
>>>>>>>>
>>>>>>>> --
>>>>>>>> Hope this helps.
>>>>>>>>
>>>>>>>> Please reply to the newsgroup unless you wish to avail yourself of
>>>>>>>> my
>>>>>>>> services on a paid consulting basis.
>>>>>>>>
>>>>>>>> Doug Robbins - Word MVP
>>>>>>>>
>>>>>>>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>>>>>>>> news:E09F6D49-1248-4A3B-8B59-9EA7639AA3E2[ at ]microsoft.com...
>>>>>>>>> I have designed a User Form. It is a Print Shop Requisition with
>>>>>>>>> various
>>>>>>>>> fields to order a printing job from the In-Plant Print Shop. My
>>>>>>>>> hope
>>>>>>>>> is
>>>>>>>>> to
>>>>>>>>> have departments fill out the form and click the Submit button at
>>>>>>>>> the
>>>>>>>>> bottom
>>>>>>>>> of the completed form and have it emailed back to me as an
>>>>>>>>> attached
>>>>>>>>> completed
>>>>>>>>> form. I have designed this type of form before, but it has been
>>>>>>>>> a
>>>>>>>>> long
>>>>>>>>> time.
>>>>>>>>> I am trying to code the "Submit" button but am having problems.
>>>>>>>>> I
>>>>>>>>> have
>>>>>>>>> copied and pasted the code from the previous form and made the
>>>>>>>>> changes
>>>>>>>>> in
>>>>>>>>> the
>>>>>>>>> form name. When I run the debug I get this error....User-defined
>>>>>>>>> type
>>>>>>>>> not
>>>>>>>>> defined. The line of code that it highlighted is the "Dim
>>>>>>>>> oOutlookApp
>>>>>>>>> As
>>>>>>>>> Outlook.Application".
>>>>>>>>>
>>>>>>>>> Can anyone help me figure this one out. Thank you in advance for
>>>>>>>>> your
>>>>>>>>> input.
>>>>>>>>>
>>>>>>>>> mptc
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>>
>>
>>
>>

--
Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

Re: Sending completed User Forms...
mptc 28.09.2006 19:39:02
Russ:

A new problem....I did as you said and went into VBA help. The window pops
up but remains blank. I have tried it several different ways and the pop up
window for VBA help is always and remains always blank.

Mike

"Russ" wrote:

[Quoted Text]
>
>
>
> Mitch,
>
> > Below is the code I am using to send the form via email.
> >
> > Thanks for your continued help.
> >
> > Mike
> >
> > Private Sub Submit_Click()
> >
> > Dim bStarted As Boolean
> > Dim oOutlookApp As Outlook.Application
> > Dim oItem As Outlook.MailItem
> >
> > On Error Resume Next
> >
> > ActiveDocument.Save
>
> Read about the .Save and .SaveAs methods in VBA help and alter the above
> line accordingly using the options you want.
> >
> > Set oOutlookApp = GetObject(, "Outlook.Application")
> > If Err <> 0 Then
> > Set oOutlookApp = CreateObject("Outlook.Application")
> > bStarted = True
> > End If
> >
> > Set oItem = oOutlookApp.CreateItem(olMailItem)
> >
> > With oItem
> > .To = "mcloghessy[ at ]xanterra.com"
> > .Subject = "Print Shop Requisition"
> > 'Add the document as an attachment, you can use the .displaynameproperty
> > 'to set the description that's used in the message
> > .Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue, _
> > DisplayName:="Print Shop Requisition"
> > .Send
> > End With
> >
> > If bStarted Then
> > oOutlookApp.quit
> > End If
> >
> > Set oItem = Nothing
> > Set oOutlookApp = Nothing
> >
> >
> > End Function
> >
> >
> >
> > "Doug Robbins - Word MVP" wrote:
> >
> >> Show us the code that you are using.
> >>
> >> --
> >> Hope this helps.
> >>
> >> Please reply to the newsgroup unless you wish to avail yourself of my
> >> services on a paid consulting basis.
> >>
> >> Doug Robbins - Word MVP
> >>
> >> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> >> news:E36556F9-AB39-442F-9834-DBDD0D3C02E6[ at ]microsoft.com...
> >>> Doug:
> >>>
> >>> Thanks for the tip, I tried several different codes but none worked the
> >>> way
> >>> I want. I guess what gave rise to this was the fact that in testing the
> >>> form
> >>> I filled out various fields and hit the "Submit" button and that worked as
> >>> planned (sending the completed form to me via email as an attachment).
> >>> After
> >>> that when I hit File > Close, Word did not prompt me as to whether I
> >>> wanted
> >>> to save the document or not. It just closed and automatically saved the
> >>> form
> >>> with the filled in fields.
> >>>
> >>> Why isn't Word prompting me as it usually does when Closing? Is there an
> >>> existing code that I need to change?
> >>>
> >>> Thanks in advance.
> >>>
> >>> Mike
> >>>
> >>> "Doug Robbins - Word MVP" wrote:
> >>>
> >>>> I guess by "within the form", you mean "within the document". I have no
> >>>> experience with the use of such controls directly in a document, but I
> >>>> would
> >>>> suspect that the procedure is just the same. You need to add some code
> >>>> after that which emails the document to reference each textbox control on
> >>>> the form and set its value or text property to "" For the checkboxes,
> >>>> you
> >>>> would set their value to 0
> >>>>
> >>>> --
> >>>> Hope this helps.
> >>>>
> >>>> Please reply to the newsgroup unless you wish to avail yourself of my
> >>>> services on a paid consulting basis.
> >>>>
> >>>> Doug Robbins - Word MVP
> >>>>
> >>>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> >>>> news:B2A3D30F-9D58-4D49-BA06-C705471EC9AD[ at ]microsoft.com...
> >>>>> I thought it was called a user form. It has text boxes, option buttons
> >>>>> and
> >>>>> check boxes within the form. I used the Visual Basic tools.
> >>>>>
> >>>>> Mike
> >>>>>
> >>>>> "Doug Robbins - Word MVP" wrote:
> >>>>>
> >>>>>> Is this actually a userform or do you have controls directly in the
> >>>>>> document?
> >>>>>>
> >>>>>> --
> >>>>>> Hope this helps.
> >>>>>>
> >>>>>> Please reply to the newsgroup unless you wish to avail yourself of my
> >>>>>> services on a paid consulting basis.
> >>>>>>
> >>>>>> Doug Robbins - Word MVP
> >>>>>>
> >>>>>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> >>>>>> news:C053C9DD-B23D-4AD0-B98D-76F70C623436[ at ]microsoft.com...
> >>>>>>> Thanks Doug, that did it! However, I have a follow up issue. After
> >>>>>>> completing the form and hitting the submit button, I don't want the
> >>>>>>> form
> >>>>>>> to
> >>>>>>> save the comments etc. IOW I want the form to revert back to the
> >>>>>>> blank
> >>>>>>> form.
> >>>>>>> I will receive the completed form via email, but the original form I
> >>>>>>> want
> >>>>>>> to
> >>>>>>> revert back to the blank form. I can save the submitted form and
> >>>>>>> the
> >>>>>>> individual departments can always save their completed form at their
> >>>>>>> end.
> >>>>>>> Is
> >>>>>>> there a code I am missing?
> >>>>>>>
> >>>>>>> Thanks!
> >>>>>>>
> >>>>>>> Mike
> >>>>>>>
> >>>>>>> "Doug Robbins - Word MVP" wrote:
> >>>>>>>
> >>>>>>>> In the Visual Basic Editor, you need to select References from the
> >>>>>>>> Tools
> >>>>>>>> menu and set a reference to the Outlook Object Library.
> >>>>>>>>
> >>>>>>>> --
> >>>>>>>> Hope this helps.
> >>>>>>>>
> >>>>>>>> Please reply to the newsgroup unless you wish to avail yourself of
> >>>>>>>> my
> >>>>>>>> services on a paid consulting basis.
> >>>>>>>>
> >>>>>>>> Doug Robbins - Word MVP
> >>>>>>>>
> >>>>>>>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> >>>>>>>> news:E09F6D49-1248-4A3B-8B59-9EA7639AA3E2[ at ]microsoft.com...
> >>>>>>>>> I have designed a User Form. It is a Print Shop Requisition with
> >>>>>>>>> various
> >>>>>>>>> fields to order a printing job from the In-Plant Print Shop. My
> >>>>>>>>> hope
> >>>>>>>>> is
> >>>>>>>>> to
> >>>>>>>>> have departments fill out the form and click the Submit button at
> >>>>>>>>> the
> >>>>>>>>> bottom
> >>>>>>>>> of the completed form and have it emailed back to me as an
> >>>>>>>>> attached
> >>>>>>>>> completed
> >>>>>>>>> form. I have designed this type of form before, but it has been
> >>>>>>>>> a
> >>>>>>>>> long
> >>>>>>>>> time.
> >>>>>>>>> I am trying to code the "Submit" button but am having problems.
> >>>>>>>>> I
> >>>>>>>>> have
> >>>>>>>>> copied and pasted the code from the previous form and made the
> >>>>>>>>> changes
> >>>>>>>>> in
> >>>>>>>>> the
> >>>>>>>>> form name. When I run the debug I get this error....User-defined
> >>>>>>>>> type
> >>>>>>>>> not
> >>>>>>>>> defined. The line of code that it highlighted is the "Dim
> >>>>>>>>> oOutlookApp
> >>>>>>>>> As
> >>>>>>>>> Outlook.Application".
> >>>>>>>>>
> >>>>>>>>> Can anyone help me figure this one out. Thank you in advance for
> >>>>>>>>> your
> >>>>>>>>> input.
> >>>>>>>>>
> >>>>>>>>> mptc
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>
> >>>>
> >>>>
> >>
> >>
> >>
>
> --
> Russ
>
> drsmN0SPAMikleAThotmailD0Tcom.INVALID
>
>
Re: Sending completed User Forms...
Russ <drsN0SPAMmikle[ at ]hotmailD0Tcom.INVALID> 29.09.2006 08:36:03
Mike,
Does anything show, if while you are in the Word VBA Editor and the cursor
is in the word 'Save' of 'ActiveDocument.Save' and you then press the F1
function key to bring up contextual VBA Help? Do you automatically get
"prompt lists" while in VBA Editor and manually typing in the "." between
legitimate object words and properties or methods? If you don't have
contextual help or automatic prompt lists, then you'll know how the
Macintosh Word VBA user feels. :(
Did you install Word yourself? What version of Word?
Click on this link for info on installing VBA Help:
http://tinyurl.com/pxovv

[Quoted Text]
> Russ:
>
> A new problem....I did as you said and went into VBA help. The window pops
> up but remains blank. I have tried it several different ways and the pop up
> window for VBA help is always and remains always blank.
>
> Mike
>
> "Russ" wrote:
>
>>
>>
>>
>> Mitch,
>>
>>> Below is the code I am using to send the form via email.
>>>
>>> Thanks for your continued help.
>>>
>>> Mike
>>>
>>> Private Sub Submit_Click()
>>>
>>> Dim bStarted As Boolean
>>> Dim oOutlookApp As Outlook.Application
>>> Dim oItem As Outlook.MailItem
>>>
>>> On Error Resume Next
>>>
>>> ActiveDocument.Save
>>
>> Read about the .Save and .SaveAs methods in VBA help and alter the above
>> line accordingly using the options you want.
>>>
>>> Set oOutlookApp = GetObject(, "Outlook.Application")
>>> If Err <> 0 Then
>>> Set oOutlookApp = CreateObject("Outlook.Application")
>>> bStarted = True
>>> End If
>>>
>>> Set oItem = oOutlookApp.CreateItem(olMailItem)
>>>
>>> With oItem
>>> .To = "mcloghessy[ at ]xanterra.com"
>>> .Subject = "Print Shop Requisition"
>>> 'Add the document as an attachment, you can use the .displaynameproperty
>>> 'to set the description that's used in the message
>>> .Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue, _
>>> DisplayName:="Print Shop Requisition"
>>> .Send
>>> End With
>>>
>>> If bStarted Then
>>> oOutlookApp.quit
>>> End If
>>>
>>> Set oItem = Nothing
>>> Set oOutlookApp = Nothing
>>>
>>>
>>> End Function
>>>
>>>
>>>
>>> "Doug Robbins - Word MVP" wrote:
>>>
>>>> Show us the code that you are using.
>>>>
>>>> --
>>>> Hope this helps.
>>>>
>>>> Please reply to the newsgroup unless you wish to avail yourself of my
>>>> services on a paid consulting basis.
>>>>
>>>> Doug Robbins - Word MVP
>>>>
>>>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>>>> news:E36556F9-AB39-442F-9834-DBDD0D3C02E6[ at ]microsoft.com...
>>>>> Doug:
>>>>>
>>>>> Thanks for the tip, I tried several different codes but none worked the
>>>>> way
>>>>> I want. I guess what gave rise to this was the fact that in testing the
>>>>> form
>>>>> I filled out various fields and hit the "Submit" button and that worked as
>>>>> planned (sending the completed form to me via email as an attachment).
>>>>> After
>>>>> that when I hit File > Close, Word did not prompt me as to whether I
>>>>> wanted
>>>>> to save the document or not. It just closed and automatically saved the
>>>>> form
>>>>> with the filled in fields.
>>>>>
>>>>> Why isn't Word prompting me as it usually does when Closing? Is there an
>>>>> existing code that I need to change?
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>> Mike
>>>>>
>>>>> "Doug Robbins - Word MVP" wrote:
>>>>>
>>>>>> I guess by "within the form", you mean "within the document". I have no
>>>>>> experience with the use of such controls directly in a document, but I
>>>>>> would
>>>>>> suspect that the procedure is just the same. You need to add some code
>>>>>> after that which emails the document to reference each textbox control on
>>>>>> the form and set its value or text property to "" For the checkboxes,
>>>>>> you
>>>>>> would set their value to 0
>>>>>>
>>>>>> --
>>>>>> Hope this helps.
>>>>>>
>>>>>> Please reply to the newsgroup unless you wish to avail yourself of my
>>>>>> services on a paid consulting basis.
>>>>>>
>>>>>> Doug Robbins - Word MVP
>>>>>>
>>>>>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>>>>>> news:B2A3D30F-9D58-4D49-BA06-C705471EC9AD[ at ]microsoft.com...
>>>>>>> I thought it was called a user form. It has text boxes, option buttons
>>>>>>> and
>>>>>>> check boxes within the form. I used the Visual Basic tools.
>>>>>>>
>>>>>>> Mike
>>>>>>>
>>>>>>> "Doug Robbins - Word MVP" wrote:
>>>>>>>
>>>>>>>> Is this actually a userform or do you have controls directly in the
>>>>>>>> document?
>>>>>>>>
>>>>>>>> --
>>>>>>>> Hope this helps.
>>>>>>>>
>>>>>>>> Please reply to the newsgroup unless you wish to avail yourself of my
>>>>>>>> services on a paid consulting basis.
>>>>>>>>
>>>>>>>> Doug Robbins - Word MVP
>>>>>>>>
>>>>>>>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>>>>>>>> news:C053C9DD-B23D-4AD0-B98D-76F70C623436[ at ]microsoft.com...
>>>>>>>>> Thanks Doug, that did it! However, I have a follow up issue. After
>>>>>>>>> completing the form and hitting the submit button, I don't want the
>>>>>>>>> form
>>>>>>>>> to
>>>>>>>>> save the comments etc. IOW I want the form to revert back to the
>>>>>>>>> blank
>>>>>>>>> form.
>>>>>>>>> I will receive the completed form via email, but the original form I
>>>>>>>>> want
>>>>>>>>> to
>>>>>>>>> revert back to the blank form. I can save the submitted form and
>>>>>>>>> the
>>>>>>>>> individual departments can always save their completed form at their
>>>>>>>>> end.
>>>>>>>>> Is
>>>>>>>>> there a code I am missing?
>>>>>>>>>
>>>>>>>>> Thanks!
>>>>>>>>>
>>>>>>>>> Mike
>>>>>>>>>
>>>>>>>>> "Doug Robbins - Word MVP" wrote:
>>>>>>>>>
>>>>>>>>>> In the Visual Basic Editor, you need to select References from the
>>>>>>>>>> Tools
>>>>>>>>>> menu and set a reference to the Outlook Object Library.
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Hope this helps.
>>>>>>>>>>
>>>>>>>>>> Please reply to the newsgroup unless you wish to avail yourself of
>>>>>>>>>> my
>>>>>>>>>> services on a paid consulting basis.
>>>>>>>>>>
>>>>>>>>>> Doug Robbins - Word MVP
>>>>>>>>>>
>>>>>>>>>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>>>>>>>>>> news:E09F6D49-1248-4A3B-8B59-9EA7639AA3E2[ at ]microsoft.com...
>>>>>>>>>>> I have designed a User Form. It is a Print Shop Requisition with
>>>>>>>>>>> various
>>>>>>>>>>> fields to order a printing job from the In-Plant Print Shop. My
>>>>>>>>>>> hope
>>>>>>>>>>> is
>>>>>>>>>>> to
>>>>>>>>>>> have departments fill out the form and click the Submit button at
>>>>>>>>>>> the
>>>>>>>>>>> bottom
>>>>>>>>>>> of the completed form and have it emailed back to me as an
>>>>>>>>>>> attached
>>>>>>>>>>> completed
>>>>>>>>>>> form. I have designed this type of form before, but it has been
>>>>>>>>>>> a
>>>>>>>>>>> long
>>>>>>>>>>> time.
>>>>>>>>>>> I am trying to code the "Submit" button but am having problems.
>>>>>>>>>>> I
>>>>>>>>>>> have
>>>>>>>>>>> copied and pasted the code from the previous form and made the
>>>>>>>>>>> changes
>>>>>>>>>>> in
>>>>>>>>>>> the
>>>>>>>>>>> form name. When I run the debug I get this error....User-defined
>>>>>>>>>>> type
>>>>>>>>>>> not
>>>>>>>>>>> defined. The line of code that it highlighted is the "Dim
>>>>>>>>>>> oOutlookApp
>>>>>>>>>>> As
>>>>>>>>>>> Outlook.Application".
>>>>>>>>>>>
>>>>>>>>>>> Can anyone help me figure this one out. Thank you in advance for
>>>>>>>>>>> your
>>>>>>>>>>> input.
>>>>>>>>>>>
>>>>>>>>>>> mptc
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>>
>>
>> --
>> Russ
>>
>> drsmN0SPAMikleAThotmailD0Tcom.INVALID
>>
>>

--
Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

Re: Sending completed User Forms...
mptc 29.09.2006 17:54:02
Thanks Russ, I got the help problem taken care of. Just frustrated now....if
I make changes within the "Active Document" section of the code, then the
comments entered by the user aren't save and the document comes to me blank.
If I try a saved code at the end of the existing code, the comments are
included in the form sent to me, but they are also saved in the original form.

After the "Submit" button is clicked and the form is sent, all I want to do
is have Word prompt me whether to save the revisions to the user form when I
close out. I would choose "no" and the next time I open the form it will
blank and ready to fill in. And nothing I do works. So unless you have a
quick answer, I am just going to drop this project for awhile. I have wasted
enough time already.

Thanks for your help

Mike


"Russ" wrote:

[Quoted Text]
> Mike,
> Does anything show, if while you are in the Word VBA Editor and the cursor
> is in the word 'Save' of 'ActiveDocument.Save' and you then press the F1
> function key to bring up contextual VBA Help? Do you automatically get
> "prompt lists" while in VBA Editor and manually typing in the "." between
> legitimate object words and properties or methods? If you don't have
> contextual help or automatic prompt lists, then you'll know how the
> Macintosh Word VBA user feels. :(
> Did you install Word yourself? What version of Word?
> Click on this link for info on installing VBA Help:
> http://tinyurl.com/pxovv
>
> > Russ:
> >
> > A new problem....I did as you said and went into VBA help. The window pops
> > up but remains blank. I have tried it several different ways and the pop up
> > window for VBA help is always and remains always blank.
> >
> > Mike
> >
> > "Russ" wrote:
> >
> >>
> >>
> >>
> >> Mitch,
> >>
> >>> Below is the code I am using to send the form via email.
> >>>
> >>> Thanks for your continued help.
> >>>
> >>> Mike
> >>>
> >>> Private Sub Submit_Click()
> >>>
> >>> Dim bStarted As Boolean
> >>> Dim oOutlookApp As Outlook.Application
> >>> Dim oItem As Outlook.MailItem
> >>>
> >>> On Error Resume Next
> >>>
> >>> ActiveDocument.Save
> >>
> >> Read about the .Save and .SaveAs methods in VBA help and alter the above
> >> line accordingly using the options you want.
> >>>
> >>> Set oOutlookApp = GetObject(, "Outlook.Application")
> >>> If Err <> 0 Then
> >>> Set oOutlookApp = CreateObject("Outlook.Application")
> >>> bStarted = True
> >>> End If
> >>>
> >>> Set oItem = oOutlookApp.CreateItem(olMailItem)
> >>>
> >>> With oItem
> >>> .To = "mcloghessy[ at ]xanterra.com"
> >>> .Subject = "Print Shop Requisition"
> >>> 'Add the document as an attachment, you can use the .displaynameproperty
> >>> 'to set the description that's used in the message
> >>> .Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue, _
> >>> DisplayName:="Print Shop Requisition"
> >>> .Send
> >>> End With
> >>>
> >>> If bStarted Then
> >>> oOutlookApp.quit
> >>> End If
> >>>
> >>> Set oItem = Nothing
> >>> Set oOutlookApp = Nothing
> >>>
> >>>
> >>> End Function
> >>>
> >>>
> >>>
> >>> "Doug Robbins - Word MVP" wrote:
> >>>
> >>>> Show us the code that you are using.
> >>>>
> >>>> --
> >>>> Hope this helps.
> >>>>
> >>>> Please reply to the newsgroup unless you wish to avail yourself of my
> >>>> services on a paid consulting basis.
> >>>>
> >>>> Doug Robbins - Word MVP
> >>>>
> >>>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> >>>> news:E36556F9-AB39-442F-9834-DBDD0D3C02E6[ at ]microsoft.com...
> >>>>> Doug:
> >>>>>
> >>>>> Thanks for the tip, I tried several different codes but none worked the
> >>>>> way
> >>>>> I want. I guess what gave rise to this was the fact that in testing the
> >>>>> form
> >>>>> I filled out various fields and hit the "Submit" button and that worked as
> >>>>> planned (sending the completed form to me via email as an attachment).
> >>>>> After
> >>>>> that when I hit File > Close, Word did not prompt me as to whether I
> >>>>> wanted
> >>>>> to save the document or not. It just closed and automatically saved the
> >>>>> form
> >>>>> with the filled in fields.
> >>>>>
> >>>>> Why isn't Word prompting me as it usually does when Closing? Is there an
> >>>>> existing code that I need to change?
> >>>>>
> >>>>> Thanks in advance.
> >>>>>
> >>>>> Mike
> >>>>>
> >>>>> "Doug Robbins - Word MVP" wrote:
> >>>>>
> >>>>>> I guess by "within the form", you mean "within the document". I have no
> >>>>>> experience with the use of such controls directly in a document, but I
> >>>>>> would
> >>>>>> suspect that the procedure is just the same. You need to add some code
> >>>>>> after that which emails the document to reference each textbox control on
> >>>>>> the form and set its value or text property to "" For the checkboxes,
> >>>>>> you
> >>>>>> would set their value to 0
> >>>>>>
> >>>>>> --
> >>>>>> Hope this helps.
> >>>>>>
> >>>>>> Please reply to the newsgroup unless you wish to avail yourself of my
> >>>>>> services on a paid consulting basis.
> >>>>>>
> >>>>>> Doug Robbins - Word MVP
> >>>>>>
> >>>>>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> >>>>>> news:B2A3D30F-9D58-4D49-BA06-C705471EC9AD[ at ]microsoft.com...
> >>>>>>> I thought it was called a user form. It has text boxes, option buttons
> >>>>>>> and
> >>>>>>> check boxes within the form. I used the Visual Basic tools.
> >>>>>>>
> >>>>>>> Mike
> >>>>>>>
> >>>>>>> "Doug Robbins - Word MVP" wrote:
> >>>>>>>
> >>>>>>>> Is this actually a userform or do you have controls directly in the
> >>>>>>>> document?
> >>>>>>>>
> >>>>>>>> --
> >>>>>>>> Hope this helps.
> >>>>>>>>
> >>>>>>>> Please reply to the newsgroup unless you wish to avail yourself of my
> >>>>>>>> services on a paid consulting basis.
> >>>>>>>>
> >>>>>>>> Doug Robbins - Word MVP
> >>>>>>>>
> >>>>>>>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> >>>>>>>> news:C053C9DD-B23D-4AD0-B98D-76F70C623436[ at ]microsoft.com...
> >>>>>>>>> Thanks Doug, that did it! However, I have a follow up issue. After
> >>>>>>>>> completing the form and hitting the submit button, I don't want the
> >>>>>>>>> form
> >>>>>>>>> to
> >>>>>>>>> save the comments etc. IOW I want the form to revert back to the
> >>>>>>>>> blank
> >>>>>>>>> form.
> >>>>>>>>> I will receive the completed form via email, but the original form I
> >>>>>>>>> want
> >>>>>>>>> to
> >>>>>>>>> revert back to the blank form. I can save the submitted form and
> >>>>>>>>> the
> >>>>>>>>> individual departments can always save their completed form at their
> >>>>>>>>> end.
> >>>>>>>>> Is
> >>>>>>>>> there a code I am missing?
> >>>>>>>>>
> >>>>>>>>> Thanks!
> >>>>>>>>>
> >>>>>>>>> Mike
> >>>>>>>>>
> >>>>>>>>> "Doug Robbins - Word MVP" wrote:
> >>>>>>>>>
> >>>>>>>>>> In the Visual Basic Editor, you need to select References from the
> >>>>>>>>>> Tools
> >>>>>>>>>> menu and set a reference to the Outlook Object Library.
> >>>>>>>>>>
> >>>>>>>>>> --
> >>>>>>>>>> Hope this helps.
> >>>>>>>>>>
> >>>>>>>>>> Please reply to the newsgroup unless you wish to avail yourself of
> >>>>>>>>>> my
> >>>>>>>>>> services on a paid consulting basis.
> >>>>>>>>>>
> >>>>>>>>>> Doug Robbins - Word MVP
> >>>>>>>>>>
> >>>>>>>>>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
> >>>>>>>>>> news:E09F6D49-1248-4A3B-8B59-9EA7639AA3E2[ at ]microsoft.com...
> >>>>>>>>>>> I have designed a User Form. It is a Print Shop Requisition with
> >>>>>>>>>>> various
> >>>>>>>>>>> fields to order a printing job from the In-Plant Print Shop. My
> >>>>>>>>>>> hope
> >>>>>>>>>>> is
> >>>>>>>>>>> to
> >>>>>>>>>>> have departments fill out the form and click the Submit button at
> >>>>>>>>>>> the
> >>>>>>>>>>> bottom
> >>>>>>>>>>> of the completed form and have it emailed back to me as an
> >>>>>>>>>>> attached
> >>>>>>>>>>> completed
> >>>>>>>>>>> form. I have designed this type of form before, but it has been
> >>>>>>>>>>> a
> >>>>>>>>>>> long
> >>>>>>>>>>> time.
> >>>>>>>>>>> I am trying to code the "Submit" button but am having problems.
> >>>>>>>>>>> I
> >>>>>>>>>>> have
> >>>>>>>>>>> copied and pasted the code from the previous form and made the
> >>>>>>>>>>> changes
> >>>>>>>>>>> in
> >>>>>>>>>>> the
> >>>>>>>>>>> form name. When I run the debug I get this error....User-defined
> >>>>>>>>>>> type
> >>>>>>>>>>> not
> >>>>>>>>>>> defined. The line of code that it highlighted is the "Dim
> >>>>>>>>>>> oOutlookApp
> >>>>>>>>>>> As
> >>>>>>>>>>> Outlook.Application".
> >>>>>>>>>>>
> >>>>>>>>>>> Can anyone help me figure this one out. Thank you in advance for
> >>>>>>>>>>> your
> >>>>>>>>>>> input.
> >>>>>>>>>>>
> >>>>>>>>>>> mptc
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>
> >>>>
> >>>>
> >>
> >> --
> >> Russ
> >>
> >> drsmN0SPAMikleAThotmailD0Tcom.INVALID
> >>
> >>
>
> --
> Russ
>
> drsmN0SPAMikleAThotmailD0Tcom.INVALID
>
>
Re: Sending completed User Forms...
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 30.09.2006 05:47:20
As I mentioned before, I have never used such controls directly in a
document, so I am not really sure how you refer to the controls in code, but
as a minimum, in your code, I would add

Dim formdoc as Document

Set formdoc = ActiveDocument

then replace

ActiveDocument.Save

with

formdoc.Save

and replace

..Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue, _
DisplayName:="Print Shop Requisition"

with

..Attachments.Add Source:=formdoc.FullName, Type:=olByValue, _
DisplayName:="Print Shop Requisition"

Then at the end of the code, you are going to need to add something like
(and here is where I am not sure:

With formdoc
.[controlname].value ="" 'repeat for each control
.Save
End With

If you can't get that to work, I would use a userform with docvariable
fields in the template that contains the userform and have the code in the
user form set the values of the variables in the document, update the fields
so that the docvariable fields display the information, then save and send
the document after which the code would remove the data from the controls on
the userform so that the process could be repeated.

See the article "How to create a Userform" at:

http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
news:89D23039-6200-4CF6-A44C-993BCCF76579[ at ]microsoft.com...
[Quoted Text]
> Below is the code I am using to send the form via email.
>
> Thanks for your continued help.
>
> Mike
>
> Private Sub Submit_Click()
>
> Dim bStarted As Boolean
> Dim oOutlookApp As Outlook.Application
> Dim oItem As Outlook.MailItem
>
> On Error Resume Next
>
> ActiveDocument.Save
>
> Set oOutlookApp = GetObject(, "Outlook.Application")
> If Err <> 0 Then
> Set oOutlookApp = CreateObject("Outlook.Application")
> bStarted = True
> End If
>
> Set oItem = oOutlookApp.CreateItem(olMailItem)
>
> With oItem
> .To = "mcloghessy[ at ]xanterra.com"
> .Subject = "Print Shop Requisition"
> 'Add the document as an attachment, you can use the
> .displaynameproperty
> 'to set the description that's used in the message
> .Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue, _
> DisplayName:="Print Shop Requisition"
> .Send
> End With
>
> If bStarted Then
> oOutlookApp.quit
> End If
>
> Set oItem = Nothing
> Set oOutlookApp = Nothing
>
>
> End Function
>
>
>
> "Doug Robbins - Word MVP" wrote:
>
>> Show us the code that you are using.
>>
>> --
>> Hope this helps.
>>
>> Please reply to the newsgroup unless you wish to avail yourself of my
>> services on a paid consulting basis.
>>
>> Doug Robbins - Word MVP
>>
>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>> news:E36556F9-AB39-442F-9834-DBDD0D3C02E6[ at ]microsoft.com...
>> > Doug:
>> >
>> > Thanks for the tip, I tried several different codes but none worked the
>> > way
>> > I want. I guess what gave rise to this was the fact that in testing
>> > the
>> > form
>> > I filled out various fields and hit the "Submit" button and that worked
>> > as
>> > planned (sending the completed form to me via email as an attachment).
>> > After
>> > that when I hit File > Close, Word did not prompt me as to whether I
>> > wanted
>> > to save the document or not. It just closed and automatically saved
>> > the
>> > form
>> > with the filled in fields.
>> >
>> > Why isn't Word prompting me as it usually does when Closing? Is there
>> > an
>> > existing code that I need to change?
>> >
>> > Thanks in advance.
>> >
>> > Mike
>> >
>> > "Doug Robbins - Word MVP" wrote:
>> >
>> >> I guess by "within the form", you mean "within the document". I have
>> >> no
>> >> experience with the use of such controls directly in a document, but I
>> >> would
>> >> suspect that the procedure is just the same. You need to add some
>> >> code
>> >> after that which emails the document to reference each textbox control
>> >> on
>> >> the form and set its value or text property to "" For the
>> >> checkboxes,
>> >> you
>> >> would set their value to 0
>> >>
>> >> --
>> >> Hope this helps.
>> >>
>> >> Please reply to the newsgroup unless you wish to avail yourself of my
>> >> services on a paid consulting basis.
>> >>
>> >> Doug Robbins - Word MVP
>> >>
>> >> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>> >> news:B2A3D30F-9D58-4D49-BA06-C705471EC9AD[ at ]microsoft.com...
>> >> >I thought it was called a user form. It has text boxes, option
>> >> >buttons
>> >> >and
>> >> > check boxes within the form. I used the Visual Basic tools.
>> >> >
>> >> > Mike
>> >> >
>> >> > "Doug Robbins - Word MVP" wrote:
>> >> >
>> >> >> Is this actually a userform or do you have controls directly in the
>> >> >> document?
>> >> >>
>> >> >> --
>> >> >> Hope this helps.
>> >> >>
>> >> >> Please reply to the newsgroup unless you wish to avail yourself of
>> >> >> my
>> >> >> services on a paid consulting basis.
>> >> >>
>> >> >> Doug Robbins - Word MVP
>> >> >>
>> >> >> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>> >> >> news:C053C9DD-B23D-4AD0-B98D-76F70C623436[ at ]microsoft.com...
>> >> >> > Thanks Doug, that did it! However, I have a follow up issue.
>> >> >> > After
>> >> >> > completing the form and hitting the submit button, I don't want
>> >> >> > the
>> >> >> > form
>> >> >> > to
>> >> >> > save the comments etc. IOW I want the form to revert back to the
>> >> >> > blank
>> >> >> > form.
>> >> >> > I will receive the completed form via email, but the original
>> >> >> > form I
>> >> >> > want
>> >> >> > to
>> >> >> > revert back to the blank form. I can save the submitted form and
>> >> >> > the
>> >> >> > individual departments can always save their completed form at
>> >> >> > their
>> >> >> > end.
>> >> >> > Is
>> >> >> > there a code I am missing?
>> >> >> >
>> >> >> > Thanks!
>> >> >> >
>> >> >> > Mike
>> >> >> >
>> >> >> > "Doug Robbins - Word MVP" wrote:
>> >> >> >
>> >> >> >> In the Visual Basic Editor, you need to select References from
>> >> >> >> the
>> >> >> >> Tools
>> >> >> >> menu and set a reference to the Outlook Object Library.
>> >> >> >>
>> >> >> >> --
>> >> >> >> Hope this helps.
>> >> >> >>
>> >> >> >> Please reply to the newsgroup unless you wish to avail yourself
>> >> >> >> of
>> >> >> >> my
>> >> >> >> services on a paid consulting basis.
>> >> >> >>
>> >> >> >> Doug Robbins - Word MVP
>> >> >> >>
>> >> >> >> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>> >> >> >> news:E09F6D49-1248-4A3B-8B59-9EA7639AA3E2[ at ]microsoft.com...
>> >> >> >> >I have designed a User Form. It is a Print Shop Requisition
>> >> >> >> >with
>> >> >> >> >various
>> >> >> >> > fields to order a printing job from the In-Plant Print Shop.
>> >> >> >> > My
>> >> >> >> > hope
>> >> >> >> > is
>> >> >> >> > to
>> >> >> >> > have departments fill out the form and click the Submit button
>> >> >> >> > at
>> >> >> >> > the
>> >> >> >> > bottom
>> >> >> >> > of the completed form and have it emailed back to me as an
>> >> >> >> > attached
>> >> >> >> > completed
>> >> >> >> > form. I have designed this type of form before, but it has
>> >> >> >> > been
>> >> >> >> > a
>> >> >> >> > long
>> >> >> >> > time.
>> >> >> >> > I am trying to code the "Submit" button but am having
>> >> >> >> > problems.
>> >> >> >> > I
>> >> >> >> > have
>> >> >> >> > copied and pasted the code from the previous form and made the
>> >> >> >> > changes
>> >> >> >> > in
>> >> >> >> > the
>> >> >> >> > form name. When I run the debug I get this
>> >> >> >> > error....User-defined
>> >> >> >> > type
>> >> >> >> > not
>> >> >> >> > defined. The line of code that it highlighted is the "Dim
>> >> >> >> > oOutlookApp
>> >> >> >> > As
>> >> >> >> > Outlook.Application".
>> >> >> >> >
>> >> >> >> > Can anyone help me figure this one out. Thank you in advance
>> >> >> >> > for
>> >> >> >> > your
>> >> >> >> > input.
>> >> >> >> >
>> >> >> >> > mptc
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>


Re: Sending completed User Forms...
Russ <drsN0SPAMmikle[ at ]hotmailD0Tcom.INVALID> 30.09.2006 07:55:01
Mike,
It looks like you are trying to re-invent the 'Template Wheel.' A template
is a document you set up to act like a cookie cutter, perhaps filled with
boilerplate text. Ignore all the mixed- metaphors ;-)

Once you get a document set up the way you want, you save it as a template
(.dot) file in the "My Templates" folder, to use occasionally; or in the
Office "Startup" folder, to load every time. Then, you use the menu
File>Project Gallery... (MacWord menu name) to pick a template to use as the
new 'not entirely blank' document to fill out and save separately as a
normal .doc document under a new unique name in the default "My Documents"
folder, for example. Each time you use File>Project Gallery... and pick your
template, you are given a fresh 'not entirely blank' document to start with,
preloaded with the stuff you want the user to see but devoid of what the
previous user filled in.
(try not to modify the Normal.dot default template that is attached to every
new blank document that is opened; create your own template for each
separate job form.)

An existing template can also be *manually* attached to a regular Normal.dot
blank document *after* it is opened. Use the menu Tools>"Templates and
Add-Ins..." to attach a template.

***
Or while a blank document is being opened by VBA code with something like...

Documents.Add Template:=Options.DefaultFilePath(Path:=wdUserTemplatesPath) &
"\My Template Name"

.... To attach your template that is in the "My Templates" folder.
***

A template could be set up to also add new menus, toolbars, and formatting
styles when it is attached to a document. Of course, read the regular Word
Help and the Word VBA Editor Help for help with templates.

[Quoted Text]
> Thanks Russ, I got the help problem taken care of. Just frustrated now....if
> I make changes within the "Active Document" section of the code, then the
> comments entered by the user aren't save and the document comes to me blank.
> If I try a saved code at the end of the existing code, the comments are
> included in the form sent to me, but they are also saved in the original form.
>
> After the "Submit" button is clicked and the form is sent, all I want to do
> is have Word prompt me whether to save the revisions to the user form when I
> close out. I would choose "no" and the next time I open the form it will
> blank and ready to fill in. And nothing I do works. So unless you have a
> quick answer, I am just going to drop this project for awhile. I have wasted
> enough time already.
>
> Thanks for your help
>
> Mike
>
>
> "Russ" wrote:
>
>> Mike,
>> Does anything show, if while you are in the Word VBA Editor and the cursor
>> is in the word 'Save' of 'ActiveDocument.Save' and you then press the F1
>> function key to bring up contextual VBA Help? Do you automatically get
>> "prompt lists" while in VBA Editor and manually typing in the "." between
>> legitimate object words and properties or methods? If you don't have
>> contextual help or automatic prompt lists, then you'll know how the
>> Macintosh Word VBA user feels. :(
>> Did you install Word yourself? What version of Word?
>> Click on this link for info on installing VBA Help:
>> http://tinyurl.com/pxovv
>>
>>> Russ:
>>>
>>> A new problem....I did as you said and went into VBA help. The window pops
>>> up but remains blank. I have tried it several different ways and the pop up
>>> window for VBA help is always and remains always blank.
>>>
>>> Mike
>>>
>>> "Russ" wrote:
>>>
>>>>
>>>>
>>>>
>>>> Mitch,
>>>>
>>>>> Below is the code I am using to send the form via email.
>>>>>
>>>>> Thanks for your continued help.
>>>>>
>>>>> Mike
>>>>>
>>>>> Private Sub Submit_Click()
>>>>>
>>>>> Dim bStarted As Boolean
>>>>> Dim oOutlookApp As Outlook.Application
>>>>> Dim oItem As Outlook.MailItem
>>>>>
>>>>> On Error Resume Next
>>>>>
>>>>> ActiveDocument.Save
>>>>
>>>> Read about the .Save and .SaveAs methods in VBA help and alter the above
>>>> line accordingly using the options you want.
>>>>>
>>>>> Set oOutlookApp = GetObject(, "Outlook.Application")
>>>>> If Err <> 0 Then
>>>>> Set oOutlookApp = CreateObject("Outlook.Application")
>>>>> bStarted = True
>>>>> End If
>>>>>
>>>>> Set oItem = oOutlookApp.CreateItem(olMailItem)
>>>>>
>>>>> With oItem
>>>>> .To = "mcloghessy[ at ]xanterra.com"
>>>>> .Subject = "Print Shop Requisition"
>>>>> 'Add the document as an attachment, you can use the
>>>>> .displaynameproperty
>>>>> 'to set the description that's used in the message
>>>>> .Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue, _
>>>>> DisplayName:="Print Shop Requisition"
>>>>> .Send
>>>>> End With
>>>>>
>>>>> If bStarted Then
>>>>> oOutlookApp.quit
>>>>> End If
>>>>>
>>>>> Set oItem = Nothing
>>>>> Set oOutlookApp = Nothing
>>>>>
>>>>>
>>>>> End Function
>>>>>
>>>>>
>>>>>
>>>>> "Doug Robbins - Word MVP" wrote:
>>>>>
>>>>>> Show us the code that you are using.
>>>>>>
>>>>>> --
>>>>>> Hope this helps.
>>>>>>
>>>>>> Please reply to the newsgroup unless you wish to avail yourself of my
>>>>>> services on a paid consulting basis.
>>>>>>
>>>>>> Doug Robbins - Word MVP
>>>>>>
>>>>>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>>>>>> news:E36556F9-AB39-442F-9834-DBDD0D3C02E6[ at ]microsoft.com...
>>>>>>> Doug:
>>>>>>>
>>>>>>> Thanks for the tip, I tried several different codes but none worked the
>>>>>>> way
>>>>>>> I want. I guess what gave rise to this was the fact that in testing the
>>>>>>> form
>>>>>>> I filled out various fields and hit the "Submit" button and that worked
>>>>>>> as
>>>>>>> planned (sending the completed form to me via email as an attachment).
>>>>>>> After
>>>>>>> that when I hit File > Close, Word did not prompt me as to whether I
>>>>>>> wanted
>>>>>>> to save the document or not. It just closed and automatically saved the
>>>>>>> form
>>>>>>> with the filled in fields.
>>>>>>>
>>>>>>> Why isn't Word prompting me as it usually does when Closing? Is there
>>>>>>> an
>>>>>>> existing code that I need to change?
>>>>>>>
>>>>>>> Thanks in advance.
>>>>>>>
>>>>>>> Mike
>>>>>>>
>>>>>>> "Doug Robbins - Word MVP" wrote:
>>>>>>>
>>>>>>>> I guess by "within the form", you mean "within the document". I have
>>>>>>>> no
>>>>>>>> experience with the use of such controls directly in a document, but I
>>>>>>>> would
>>>>>>>> suspect that the procedure is just the same. You need to add some code
>>>>>>>> after that which emails the document to reference each textbox control
>>>>>>>> on
>>>>>>>> the form and set its value or text property to "" For the checkboxes,
>>>>>>>> you
>>>>>>>> would set their value to 0
>>>>>>>>
>>>>>>>> --
>>>>>>>> Hope this helps.
>>>>>>>>
>>>>>>>> Please reply to the newsgroup unless you wish to avail yourself of my
>>>>>>>> services on a paid consulting basis.
>>>>>>>>
>>>>>>>> Doug Robbins - Word MVP
>>>>>>>>
>>>>>>>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>>>>>>>> news:B2A3D30F-9D58-4D49-BA06-C705471EC9AD[ at ]microsoft.com...
>>>>>>>>> I thought it was called a user form. It has text boxes, option
>>>>>>>>> buttons
>>>>>>>>> and
>>>>>>>>> check boxes within the form. I used the Visual Basic tools.
>>>>>>>>>
>>>>>>>>> Mike
>>>>>>>>>
>>>>>>>>> "Doug Robbins - Word MVP" wrote:
>>>>>>>>>
>>>>>>>>>> Is this actually a userform or do you have controls directly in the
>>>>>>>>>> document?
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Hope this helps.
>>>>>>>>>>
>>>>>>>>>> Please reply to the newsgroup unless you wish to avail yourself of my
>>>>>>>>>> services on a paid consulting basis.
>>>>>>>>>>
>>>>>>>>>> Doug Robbins - Word MVP
>>>>>>>>>>
>>>>>>>>>> "mptc" <mptc[ at ]discussions.microsoft.com> wrote in message
>>>>>>>>>> news:C053C9DD-B23D-4AD0-B98D-76F70C623436[ at ]microsoft.com...
>>>>>>>>>>> Thanks Doug, that did it! However, I have a follow up issue. After
>>>>>>>>>>> completing the form and hitting the submit button, I don't want the
>>>>>>>>>>> form
>>>>>>>>>>> to
>>>>>>>>>>> save the comments etc. IOW I want the form to revert back to the
>>>>>>>>>>> blank
>>>>>>>>>>> form.
>>>>>>>>>>> I will receive the completed form via email, but the original form I
>>>>>>>>>>> want
>>>>>>>>>>> to
>>>>>>>>>>> revert back to the blank form. I can save the submitted form and
>>>>>>>>>>> the
>>>>>>>>>>> individual departments can always save their completed form at their
>>>>>>>>>>> end.
>>>>>>>>>>> Is
>>>>>>>>>>> there a code I am missing?
>>>>>>>>>>>
>>>>>>>>>>> Thanks!
>>>>>>>>>>>
>>>>>>>>>>> Mike
>>&g