Hello Don
I will leave the experts to answer your question but: Why use EmpName? Why
not use the user's Windows logon name? Using the logon name means the user
does not have to type./select anything.
Cheers
td
> I'm new to macros and the like, so please be gentle to me and explicit with
> me. :)
[quoted text clipped - 25 lines]
> Thanks in advance,
> Don
Don Wilkinson - 02 May 2006 18:21 GMT
TD,
the "EmpName" field refers to a thrid party, not the current user.
Thanks,
Don
> Hello Don
> I will leave the experts to answer your question but: Why use EmpName? Why
[quoted text clipped - 32 lines]
> > Thanks in advance,
> > Don
Use the following code in a macro that is run on exit from the "EmpName"
form field
ActiveDocument.SaveAs ActiveDocument.Bookmarks("EmpName").Result & " -
completed form"

Signature
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
> I'm new to macros and the like, so please be gentle to me and explicit
> with
[quoted text clipped - 29 lines]
> Thanks in advance,
> Don
Don Wilkinson - 02 May 2006 18:22 GMT
Doug,
thank you. I will go and try it. Assuming I can figure out the basics of
using code from Word form... That's my homework.
I actually expect myself to learn some things on my own. Not to have
everything handed to me. ;-)
Don
> Use the following code in a macro that is run on exit from the "EmpName"
> form field
[quoted text clipped - 35 lines]
> > Thanks in advance,
> > Don
Don Wilkinson - 02 May 2006 19:04 GMT
Hello Doug,
I created a macro in my form template. I tested the new form and when I
enter data into the EmpName field and move to the next field (exit) I get
this error:
"Compile Error: Method or Data member not found."
and the ".Result" part of the macro code is highlighted in the VB debug
window. This is Word 2003SP2, btw. I don't have a reference to supported
methods; is .Results "good"? :)
Here is my code block for the macro in TemplateProject-Modules-Module1:
Sub SaveFormWithName()
ActiveDocument.SaveAs ActiveDocument.Bookmarks("EmpName").Result & "
- completed form"
End Sub
Note: when I pasted your code sample, I added indent. Also, the editor
wordwrapped the string and added an extra doublequote to the end of the line,
which looked to me like it would break the string. So, I 'corrected' it to
what you see above.
If I get it working, I'll probably recode a bit more to something like;
Sub SaveFormWithName()
ActiveDocument.SaveAs & "UserSetupRequest-"
ActiveDocument.Bookmarks("EmpName").Result
End Sub
> Use the following code in a macro that is run on exit from the "EmpName"
> form field
[quoted text clipped - 35 lines]
> > Thanks in advance,
> > Don
Don Wilkinson - 02 May 2006 23:16 GMT
Hello again, Doug,
I very much appreciate your time. Having been in you position many times, I
know that it's often diffcult, and rarely attempted, to help someone with
their script problems. It's often something as simple but as elusive as a
misplaced space character and the like. :)
In this case, I think that my post may have workwrapped in such a way as to
mislead you you as to the cause of the error I reported or something. I
don't think I am having a syntax problem due to not using the proper
'continued on next line' character or the like.
As I specifically showed before, the debugger is complaining about the
*method* and it's highlighting ".Result".
I reemphasize this because my script was all on one line - linewrapping does
not seem a likely cause to my problem. Furthermore, I've tried changing the
code to match what you gave me in format and got the same error.
Finally, I changed the code to:
Sub SaveFormWithName()
ActiveDocument.SaveAs ActiveDocument.Bookmarks("EmpName").Result
End Sub
And got the SAME error. Next idea? :)
Thanks,
Don
> Hello Doug,
>
[quoted text clipped - 66 lines]
> > > Thanks in advance,
> > > Don
Doug Robbins - Word MVP - 04 May 2006 21:11 GMT
Hi Don,
Sorry the problem is an error in the code that I gave you. It should have
been:
ActiveDocument.SaveAs ActiveDocument.FormFields("EmpName").Result etc.
The .Result is a property of a FormField, not a bookmark

Signature
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
> Hello again, Doug,
>
[quoted text clipped - 112 lines]
>> > > Thanks in advance,
>> > > Don
Doug Robbins - Word MVP - 02 May 2006 22:17 GMT
The
ActiveDocument.SaveAs ActiveDocument.Bookmarks("EmpName").Result & "
- completed form"
needs to be all on one line or have a Visual Basic line break character
inserted like
ActiveDocument.SaveAs ActiveDocument.Bookmarks("EmpName").Result & _
" - completed form"
Note that there is a space between the ampersand and the underscore
character.

Signature
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
> Use the following code in a macro that is run on exit from the "EmpName"
> form field
[quoted text clipped - 37 lines]
>> Thanks in advance,
>> Don