Need help with my word doc



Ana ana via OfficeKB.com
07-09-2005, 11:03 PM
Hi,
I need help in my word doc :-( every time I add VB button to generate date
and time or just use clear button to clear some fields it will work for the
1st time but when I save the doc and exit and come back again all of my
buttons will NOT work? Any Idea on how I can keep it working?

Thx,
Ana

Charles Kenyon
07-09-2005, 11:03 PM
Consider using fields in templates for your dates. If you need to use
macros, put them in the template (rather than normal.dot) and assign custom
toolbar custom buttons to the macros rather than ActiveX controls.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"Ana ana via OfficeKB.com" <forum@nospam.OfficeKB.com> wrote in message
news:9c65de8f91654a6aaa1a8be7088c5dc9@OfficeKB.com...
> Hi,
> I need help in my word doc :-( every time I add VB button to generate date
> and time or just use clear button to clear some fields it will work for
> the
> 1st time but when I save the doc and exit and come back again all of my
> buttons will NOT work? Any Idea on how I can keep it working?
>
> Thx,
> Ana

Ana ana via OfficeKB.com
07-09-2005, 11:03 PM
Thank you Charles. I didn't use macro what i did is adding this code for
the buttons:
=========================================
Private Sub CommandButton1_Click()
Label1.Caption = Format(Now, "General Date")
End Sub

Private Sub CommandButton11_Click()

End Sub

Private Sub CommandButton2_Click()
Label1.Caption = " "

End Sub



Private Sub Label1_Click()

End Sub
=============================================

All works but after I close the doc and reopen it the code didn't work :-(

Thx for your help

--
Message posted via http://www.officekb.com

Charles Kenyon
07-09-2005, 11:03 PM
These are (nonfunctional) macros. Code = macro. Your document will trigger
macro alerts or security.
Consider whether fields will meet your needs rather than command buttons.
See http://addbalance.com/word/datefields1.htm for information on the
different kinds of datefields and how to format them.

See http://addbalance.com/word/datefields2.htm for information on the
different kinds of ways to make a date calculation work. It includes links
to pages with fields and an explanation of different macros that can be used
instead of fields.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.



"Ana ana via OfficeKB.com" <forum@OfficeKB.com> wrote in message
news:e53ad9a24e7b4aac8948a75944d7a67c@OfficeKB.com...
> Thank you Charles. I didn't use macro what i did is adding this code for
> the buttons:
> =========================================
> Private Sub CommandButton1_Click()
> Label1.Caption = Format(Now, "General Date")
> End Sub
>
> Private Sub CommandButton11_Click()
>
> End Sub
>
> Private Sub CommandButton2_Click()
> Label1.Caption = " "
>
> End Sub
>
>
>
> Private Sub Label1_Click()
>
> End Sub
> =============================================
>
> All works but after I close the doc and reopen it the code didn't work :-(
>
> Thx for your help
>
> --
> Message posted via http://www.officekb.com

Ana ana via OfficeKB.com
07-09-2005, 11:03 PM
Thank you Charles, I am not that good with macro :-(... Do you know why VB
commands wont works after saving MS Word? Any fix or setting for me to do!
Thanks again for your help. :-)

Ana

--
Message posted via http://www.officekb.com

Charles Kenyon
07-09-2005, 11:03 PM
Ana,

You are in over both of our heads. Again, look into using fields if you
don't understand vba. See http://addbalance.com/word/datefields2.htm for
information on the different kinds of ways to make a date calculation work.
It includes links to pages with fields and an explanation of different
macros that can be used instead of fields.

Your code may be being stored somewhere else and not saved when you save
your document.

--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"Ana ana via OfficeKB.com" <forum@OfficeKB.com> wrote in message
news:4FCF5853C6700@OfficeKB.com...
> Thank you Charles, I am not that good with macro :-(... Do you know why VB
> commands wont works after saving MS Word? Any fix or setting for me to do!
> Thanks again for your help. :-)
>
> Ana
>
> --
> Message posted via http://www.officekb.com


Need help with my word doc