Results 1 to 9 of 9
  1. #1
    New Lounger
    Join Date
    Mar 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Easy Word Macro Help (Word 2000)

    Simple for some, but I' m just starting with Word VBA-Macros

    I want to go to a specific bookmark when the document opens.

    I want to know how to include multiple checkboxes in a "range", kind of like the checkit() and uncheck() subroutines in ms word professional fax examples.

    How can I automatically calculate a calculated field without manually updating it using keystoke or menu. i.e. as they type value, hit enter whammy it updates the total.

    TIA,

    Jason

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Easy Word Macro Help (Word 2000)

    Edited to fix Macro Name
    Question 1. Record a macro named AutoOpen in which you goto the specific bookmark.

    Qeustion 2. Microsoft's Professional Fax template uses a Macrobutton field, two macros and two autotext entries to do that. You can do the same if you copy all of those into your template.

    Question 3. If you are using form fields where the user types the value, you can attach an OnExit macro to each field so that when the user moves out of that field, a macro runs. The macro would need to contain a line similar to this
    ActiveDocument.Range.Fields.Update

    If you are not using form fields then applying the whammy step is probably more trouble than it is worth.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    New Lounger
    Join Date
    Mar 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Easy Word Macro Help (Word 2000)

    Thanks for the advice.

  4. #4
    New Lounger
    Join Date
    Mar 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Easy Word Macro Help (Word 2000)

    Thanks for the help.

  5. #5
    New Lounger
    Join Date
    Mar 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Easy Word Macro Help (Word 2000)

    OK, I insterted the AutoOpen() macro, telling it to go to a specific bookmark. It works in the template, but when I try to open a doc from that template it does not work. All the rest of the macros I have work. Am I missing a step?

  6. #6
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Easy Word Macro Help (Word 2000)

    When you say, "open a doc from that template it does not work", do you mean when you create a new document based on that template?

    If you want it to work when you create a new document, you must call the macro AutoNew(). This will fire when you create a new document based on that template.

    Once you have created the document based on that template, the next time you open it, the AutoOpen macro should run.

    If you want the macro to run both times, you will need both and AutoOpen and an AutoNew macro.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  7. #7
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Easy Word Macro Help (Word 2000)

    <P ID="edit" class=small>(Edited by Phil Rabichow on 04-Mar-03 11:08. to correct first statement regarding location of AutoOpen)</P>It would probably be better to ask one question per post, as it makes it easier to find at a latter time. Nevertheless, for your first & 3rd questions:
    1. Use the following macro & call it AutoOpen:
    Sub AutoOpen()
    '
    Selection.GoTo What:=wdGoToBookmark, Name:="PutYourBookmarkNameHere"
    End Sub

    3. One way: If you protect a document for forms & use formfields for calculations, you can go to formfield properties & check the box that says calculate on exit. Do this for the fields that are part of the calculation; it's not necessary to do it for the Total field.

    Hope this helps.

  8. #8
    New Lounger
    Join Date
    Mar 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Easy Word Macro Help (Word 2000)

    Thanks Bryan, the AutoNew() worked. That was exactly what I was looking for and I have learned quite a bit just by playing with it (and ya'lls help of course)!

    Thanks,

  9. #9
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Brussels, Brussel, Belgium
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Easy Word Macro Help (Word 2000)

    or you can put the code that is in your autonew and put it in the Document_New() sub of the thisdocument clas module of the template (see picture)
    have word create the procedure stub for you by unsing the comboboxes on top (doubleclick ThisDocument in the project explorer, choose "Document" in the left drop down combobox and "New" in the right)

    greetings,
    Attached Images Attached Images

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •