Group: microsoft.public.word.vba.general
From: =?Utf-8?B?Q3VydA==?=
Date: Thursday, November 29, 2007 1:43 PM
Subject: Re: converting a file

Have tried what you suggested to no avail. I think I've tried every way I can
think of to get it to find this file. on the 27 I did post my code each
routine is opened from a option button on a user form. could the fact that
yearlya was created in a newer version than I am useing be the culprit?

"Graham Mayor" wrote:

> When you open a document from a location other than the default document
> location Word shifts focus to that folder for the purpose of file > open,
> until you close Word or until you open a document from another folder.
> Without having your document/code to verify, once the first document is
> opened then the focus is moved to the folder that contains it. So my
> conjecture was that if you change
> Set WordDoc = Word.Documents.Open("\parade\yearlya.doc")
> to
> Set WordDoc = Word.Documents.Open("yearlya.doc")
> the document may be found.
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
>
> Curt wrote:
> > both documents are not open at same time. Each is opened from a
> > userform seperatly. I have put yearlya into both code areas same
> > results. Yearly opens but converted file cannot find. I don't follow
> > how I cam remove the path from code and have any thing happen.
> > Will keep experminting
> > Thanks Again
> >
> > "Graham Mayor" wrote:
> >
> >> On further reflection try removing the path from the second
> >> document. If it is opened from the same folder as the first the path
> >> will be wrong.
> >>
> >> --
> >> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >> Graham Mayor - Word MVP
> >>
> >> My web site www.gmayor.com
> >> Word MVP web site http://word.mvps.org
> >> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >>
> >> Graham Mayor wrote:
> >>> I suspect it is more to do with the fact that once you have opened
> >>> the first file, while Word remains open, the focus has moved from
> >>> the default folder to the folder that contains the first document
> >>> so that path would need to be from there or you would have to reset
> >>> the path to its default before opening the second document.
> >>>
> >>>
> >>> Curt wrote:
> >>>> appreciate your responce. The path works on file I created
> >>>> (yearly)not on converted (yearlya) in same folder also I've learned
> >>>> that the converted file was created in office 2003 I am useing 2000
> >>>> this may be problem.
> >>>> Thanks Again
> >>>>
> >>>> "Graham Mayor" wrote:
> >>>>
> >>>>> It won't work because you have not told the macro from where to
> >>>>> start looking for the path. . You will need to ensure that your
> >>>>> documents are filed with direct relationship to (say) the Word
> >>>>> documents folder and adjust the relative path to suit in order for
> >>>>> the command to find it.
> >>>>> eg
> >>>>> Dim WordDoc As Word.Document
> >>>>> Dim ParadePath As String
> >>>>> ParadePath = Options.DefaultFilePath(wdDocumentsPath)
> >>>>> Set WordDoc = Word.Documents.Open(ParadePath &
> >>>>> "\parade\yearly.doc")
> >>>>>
> >>>>> --
> >>>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >>>>> Graham Mayor - Word MVP
> >>>>>
> >>>>> My web site www.gmayor.com
> >>>>> Word MVP web site http://word.mvps.org
> >>>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >>>>>
> >>>>>
> >>>>>
> >>>>> Curt wrote:
> >>>>>> What I don't understand is why the following code will not find
> >>>>>> this file. It will only find it if I use the complete path from
> >>>>>> the properties of file. yearly is a .doc I wrote yearlya is the
> >>>>>> converted file. Both files a next to each other in folder. Reason
> >>>>>> for shorten path is for use on machines that do not load to C.
> >>>>>> Want program to look in folder.
> >>>>>> Thanks
> >>>>>> Private Sub optionbutton35_Click()
> >>>>>> OptionButton35.Value = False
> >>>>>> Dim Word As New Word.Application
> >>>>>> Dim WordDoc As Word.Document
> >>>>>> Word.Visible = True
> >>>>>> Set WordDoc = Word.Documents.Open("\parade\yearly.doc")
> >>>>>> End Sub
> >>>>>> Private Sub Optionbutton36_Click()
> >>>>>> OptionButton36.Value = False
> >>>>>> 'Call year
> >>>>>> Dim Word As New Word.Application
> >>>>>> Dim WordDoc As Word.Document
> >>>>>> Set Word = New Word.Application
> >>>>>> Word.Visible = True
> >>>>>> Set WordDoc = Word.Documents.Open("\parade\yearlya.doc")
> >>>>>> Word.Visible = True
> >>>>>> end sub
> >>>>>>
> >>>>>> "Graham Mayor" wrote:
> >>>>>>
> >>>>>>> If you saved the rtf file as a Word Document then that's what it
> >>>>>>> now is.
> >>>>>>>
> >>>>>>> --
> >>>>>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >>>>>>> Graham Mayor - Word MVP
> >>>>>>>
> >>>>>>> My web site www.gmayor.com
> >>>>>>> Word MVP web site http://word.mvps.org
> >>>>>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> >>>>>>>
> >>>>>>> Curt wrote:
> >>>>>>>> Have a rtf file saved as a word.doc no good for locate. No
> >>>>>>>> matter how I try to use this file code will not locate file.
> >>>>>>>> Is there a way to convert this file so it is a reconizable
> >>>>>>>> word.dco? It opens with word ok. I am useing office 2000.
> >>>>>>>> Thanks
>
>
>

Safety Articles | Usenet Groups | Usenet News | Bluegrass