JimInMinneapolis
Thu Oct 20 16:23:03 CDT 2005
Thanks, Jay!
You're fantastic. It works wonderfully.
I am grateful for your help.
Bye
Jim
"Jay Freedman" wrote:
> Hi Jim,
>
> Yeah, I forgot about the limit on the Work menu. Nice idea while it lasted.
> <g>
>
> Your change missed the backslash that has to go between the word
> Descriptions and the quote mark. Word was trying to open a file named
> ^JobDescriptions1.doc and failing with a "file not found" error, but the On
> Error trap caught the problem and simply ended the macro without a big nasty
> error message.
>
> If you want something a little more informative when the macro runs into
> trouble, add these lines just after the End If line:
>
> If Err.Number <> 0 Then
> MsgBox Err.Description
> End If
>
> --
> Regards,
> Jay Freedman
> Microsoft Word MVP FAQ:
http://word.mvps.org
>
> Jim In Minneapolis wrote:
> > Hi Jay. Thanks for helping me.
> >
> > Ok. I looked at the "Work Menu" FAQ. But I think it says you can
> > only use 10 documents . . when adding the 11th it 'bumps' the old #1
> > doc off the list! So, since I already have 30 docs . . and probably
> > more to go . . . that won't work.
> >
> > Regarding the macro you kindly wrote for me, when I use it here's what
> > happens:
> > (a) The 'dialogue' box pops up (very nice!). It says "enter doc"
> > (b) I type in 1 (just the number 1) and click
> > (c) The dialogue box disappears, but then NOTHING happens. (I'm
> > left just looking at a blank empty page).
> >
> > Woud you mind looking at the exact code below? I have edited your
> > macro just to indicate the correct full path for my actual document
> > folder. That's all I changed. Note there IS a ^ symbol in the file
> > path--just so it doesnt 'look like a typo!
> >
> > Here it is:
> >
> > Sub OpenNumberedDoc()
> > Dim TheNumber As String
> >
> > On Error Resume Next
> > TheNumber = InputBox$("Enter the doc number")
> > If TheNumber <> "" Then
> > Documents.Open FileName:= _
> > "C:\MS Word Documents\Cheap Resumes and Typing
> > While-You-Wait\^Job Descriptions" & TheNumber & ".doc"
> > End If
> > End Sub
> >
> > "Jay Freedman" wrote:
> >
> >> Hi Jim,
> >>
> >> Taking your request literally, this macro will do what you asked:
> >>
> >> Sub OpenNumberedDoc()
> >> Dim TheNumber As String
> >>
> >> On Error Resume Next
> >> TheNumber = InputBox$("Enter the doc number")
> >> If TheNumber <> "" Then
> >> Documents.Open FileName:= _
> >> "c:\MS Word Docs\" & TheNumber & ".doc"
> >> End If
> >> End Sub
> >>
> >> Thinking a bit sideways, though, you might be better off using the
> >> Work menu (
http://word.mvps.org/FAQs/General/WorkMenu.htm).
> >>
> >> --
> >> Regards,
> >> Jay Freedman
> >> Microsoft Word MVP FAQ:
http://word.mvps.org
> >>
> >> Jim In Minneapolis wrote:
> >>> Hi
> >>>
> >>> Does anyone know how to make this macro? You'll be a 'life-saver'
> >>> for me if you do!
> >>>
> >>> (NOTE: I do not have any experience using the macro "editor" --
> >>> I've only used the 'record macro' function so far. So if you want
> >>> me to enter some code, would you please just write it in a way I can
> >>> "cut-n-paste" into the editor?)
> >>>
> >>> STEPS:
> >>> (a) Click on toolbar macro icon
> >>> (b) This should bring up an "enter value" dialog box on the screen
> >>> (c) I will then type-in: 1 (i.e. I just type the number one)
> >>> (d) I click "ok" (or whatever the dialog box wants)
> >>> (e) Then Word opens this specific document on my hard drive:
> >>> c:\MS Word Docs\1.doc
> >>>
> >>> (I have about 30 documents . . . so, depending on what # is entered
> >>> in the dialog box, the corresponding document will open . . . i.e.
> >>> 1.doc, 2.doc,
> >>> 3.doc . . .)
> >>>
> >>> Thanks so much! I know this is probably pretty simple for you
> >>> macro pros, but I don't know how to do it.
> >>>
> >>> Gratefully . . .
>
>
>