Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Why does this code fail?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dale - 20 Mar 2006 18:24 GMT
Hello all,

Would someone be so kind as to look at the following and tell me why this
code is intermittent/fails?  Is my logic faulty?

With Dialogs(wdDialogFileSaveAs)

   If Dir("J:\LASER\" & PATH & "\") <> "" Then

       .Name = "J:\LASER\" & PATH & "\LaserAddressSimulation.doc"

   Else

       .Name = "J:\LASER\LaserAddressSimulation.doc"

   End If

   .Display
   .Execute

End With
Doug Robbins - Word MVP - 20 Mar 2006 19:48 GMT
I would use:

Dim Path As String, fname As String
If Dir("J:\LASER\" & Path & "\") <> "" Then
   fname = "J:\LASER\" & Path & "LaserAddressSimulation.doc"
Else
   fname = "J:\LASER\LaserAddressSimulation.doc"
End If
ActiveDocument.SaveAs fname

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Hello all,
>
[quoted text clipped - 17 lines]
>
> End With
Dale - 20 Mar 2006 19:59 GMT
Doug,

Any particular reason you would axe the Word dialog box?

Dale

>I would use:
>
[quoted text clipped - 27 lines]
>>
>> End With
Doug Robbins - Word MVP - 20 Mar 2006 22:19 GMT
It wasn't necessary.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Doug,
>
[quoted text clipped - 33 lines]
>>>
>>> End With
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.