Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 12-06-2019, 08:21 PM
macropod's Avatar
macropod macropod is offline Macro now requires file extension entered to open document Windows 7 64bit Macro now requires file extension entered to open document Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,514
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try the following simplified version of your macro:
Code:
Sub Travellers()
    MsgBox ("IS FINEPRINT SET AS THE DEFAULT PRINTER?")
    fsDT = InputBox("Due Date is...", "Due Date", "DUE DATE")
    If File = "quit" Then Num = 1 Else Num = 0
    Do While Num = 0
        fsWON = InputBox("Enter Work Order Number or press Cancel to exit", "Work Order #", "Work Order Number")
        If fsWON = "" Then Exit Do
        File = InputBox("Name of the Part File to open?", "Open File", "Part Number")
        QTY = InputBox("Order Quantity is...", "Order Quantity", "Quantity")
        Documents.Open FileName:="S:\Word\Parts\" & File & ".doc", _
            ConfirmConversions:=False, ReadOnly:=True, AddToRecentFiles:=False, _
            Revert:=False, Format:=wdOpenFormatAuto, XMLTransform:=""
        With ActiveDocument
            With .Find
                .ClearFormatting
                .Replacement.ClearFormatting
                .Forward = True
                .Wrap = wdFindContinue
                .Format = False
                .MatchCase = False
                .MatchWholeWord = False
                .MatchWildcards = False
                .MatchSoundsLike = False
                .MatchAllWordForms = False
                .Text = "WRKORD"
                .Replacement.Text = fsWON
                .Execute Replace:=wdReplaceAll
                .Text = "QTY"
                .Replacement.Text = QTY
                .Execute Replace:=wdReplaceAll
                .Text = "DDT"
                .Replacement.Text = fsDT
                .Execute Replace:=wdReplaceAll
            End With
            .PrintOut Background = True
            .Close SaveChanges:=wdDoNotSaveChanges
        End With
    Loop
End Sub
Note, particularly, the Documents.Open line.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
OneNote requires interent access to open??? rasmasyean OneNote 0 02-13-2017 01:59 PM
Macro now requires file extension entered to open document Macro to Open to a Website When No Document Is Open lostinwebspace Word VBA 1 02-13-2016 10:28 AM
File extension issues lkernen Excel 11 11-12-2013 01:17 PM
Macro now requires file extension entered to open document excel cannot open the file .xlsx because the file format or file extension is not val teddysika Excel 1 11-22-2012 06:06 AM
Getting COMException Incompatible file type and file extension sbalerao Mail Merge 0 04-21-2011 10:30 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:16 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft