![]() |
|
#2
|
||||
|
||||
|
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
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
| 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 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 |
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 |