Results 1 to 7 of 7
  1. #1
    kelliel
    Guest

    Passing Parameters Option

    Referring to the thread at <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showflat.pl?Cat=&Board=vb&Number=14200&page=3&view =expanded&sb=5>http://www.wopr.com/cgi-bin/w3t/showflat.p...w=expanded&sb=5</A>

    We have come up with a way to pass parameters in Word 97 (which doesn't "allow" parameter passing).

    We set a custom document property in the normal.dot, use that value in the procedures (thus it is "passed"), and then delete the variable when done.

    The code is in the attached text file.

    Enjoy.

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Passing Parameters Option

    I do the same thing with autotext if I need a formatted "string" (underlined, etc.) created in one mod and used in another.

    Of course, I'n not sure what you mean by Word 97 not allowing parameter passing. You can certainly pass parameters to subs and UDFs, so what do you mean?

    Anyway, another good technique is to use the .tag property of forms and controls to make "passed" values available to code mods - as long as the form is still loaded, the values are available anywhere (hide the form, but don't unload it if you don't need the user to see it).
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    kelliel
    Guest

    Re: Passing Parameters Option

    Thanks for the question. Regarding Word 97 passing parameters, I was using the terminology started in the thread to which I referred.

    I was referring to the fact that Application.Run("macroname") in Word 97 does not allow parameter passing.

    Thanks

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Passing Parameters Option

    Thanks for clarifying. Sorry, I didn't look at the referenced post.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  5. #5
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Passing Parameters Option

    Lawrence,

    My only problem with this is that I suspect it would set normal.dot "dirty". I have the option set to notify me if normal.dot is going to be overwritten, so I'd probably get notified every time this macro was run(?)
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  6. #6
    kelliel
    Guest

    Re: Passing Parameters Option

    Nope. The line:

    NormalTemplate.Saved = True

    Solves that! Sneaky, huh?

    (Don't ya just love it. Something was done right!)

  7. #7
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Passing Parameters Option

    OK, serves me right for not reading the code properly.

    OK, now here's a new scenario. I've added a new button. The code gets rung, and I exit Word. I don't get prompted for saving normal.dot, and I lose my button.

    So you might want something like:

    dim blnSaved as Boolean

    blnSaved = normaltemplate.saved

    (do stuff)

    normaltemplate.saved = blnSaved
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

Posting Permissions

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