D
DFStoneJr
After several years of working with VBA in Excel, I'm now starting to
visit the world of Word. It's driving me nuts.
The following two macros are stored in the same module in Normal.dot:
Sub FileFolderLabels()
Application.MailingLabel.DefaultPrintBarCode = False
Application.MailingLabel.CreateNewDocument Name:="5066",
Address:="", _
AutoText:="ToolsCreateLabels1", LaserTray:=wdPrinterManualFeed,
_
ExtractAddress:=False, PrintEPostageLabel:=False,
Vertical:=False
End Sub
Sub FaxCover()
Documents.Add Template:= _
"C:\Documents and Settings\dstone\Application
Data\Microsoft\Templates\FAX.dot" _
, NewTemplate:=False, DocumentType:=0
End Sub
The former generates this error message: "Compile Error. Expected End
Sub" on the first line.
The latter generates this error message: "Compile error. Only comments
may appear after End Sub, End Function or End Property" before it even
gets to the first line.
I've tried separating them into different modules. I've tried deleting
all blank lines in the code.
What am I missing? Why won't the code execute?
visit the world of Word. It's driving me nuts.
The following two macros are stored in the same module in Normal.dot:
Sub FileFolderLabels()
Application.MailingLabel.DefaultPrintBarCode = False
Application.MailingLabel.CreateNewDocument Name:="5066",
Address:="", _
AutoText:="ToolsCreateLabels1", LaserTray:=wdPrinterManualFeed,
_
ExtractAddress:=False, PrintEPostageLabel:=False,
Vertical:=False
End Sub
Sub FaxCover()
Documents.Add Template:= _
"C:\Documents and Settings\dstone\Application
Data\Microsoft\Templates\FAX.dot" _
, NewTemplate:=False, DocumentType:=0
End Sub
The former generates this error message: "Compile Error. Expected End
Sub" on the first line.
The latter generates this error message: "Compile error. Only comments
may appear after End Sub, End Function or End Property" before it even
gets to the first line.
I've tried separating them into different modules. I've tried deleting
all blank lines in the code.
What am I missing? Why won't the code execute?