Curt
Fri Nov 30 20:09:00 PST 2007
All files for program are in a folder on the desktop called (Parade) path
from properties of folder is C:\Documents and Settings\Curtiss A.
Greer\Desktop
all action takes place inside of folder parade.
A userform with option buttons to open is used to get to the files. The code
posted on the 27 shows code for both option buttons. Not trying to create an
install only open this file.(yearlya) I wrote a mocro in word contolled it
from excel it opened yearly then ran word macro opened yearlya then put
yearly on top. When you closed yearly yearlya was there. What I ened up with
was both files open. Think I am going to walk away till after Christmass.
This program did even with bugs pulled ths Vet's Day Parade out in order. No
one knew till after the parade about the snauff. Sure do appreciate all who
man this forum.
Thanks & Merry Christmass to All
Graham Mayor" wrote:
> Let's have a re-think. Where exactly are you storing these documents? I can
> see they are in a folder called parade, but where are your storing this
> folder. e.g. set your install routine to use a specific folder such as a sub
> folder of the startup folder. That will give you a start point no matter
> where the start folder is locates on a particular pc. This gives you routine
> somewhere to search from eg
>
> File1 = Options.DefaultFilePath(wdStartupPath) & "\parade\yearly.doc"
> Set WordDoc = Word.Documents.Open(File1)
> and
> file2 = Options.DefaultFilePath(wdStartupPath) & "\parade\yearlya.doc"
> Set WordDoc = Word.Documents.Open(file2)
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site
http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
>
> Curt wrote:
> > 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
>
>
>