what is the equivalent of this WordBasic code in VBA

W

WordBasic to VBA

I'm getting wrong values for the variables for the month in this snippet of
codes. This is WordBasic code and when I open the program program in word
2007 on a different computer it's telling me I'm working in the wrong month
or I'm working in the wrong ducoment. Yes I converted it. Can you please
help me. Thank you for looking at it. I would like to know how to put it into
Visual basic .net.


WordBasic.StartOfDocument
BUTTON = WordBasic.MsgBox("IS THIS A NEW DOCUMENT ?", " MONTHLY SALES
TAX", 260)

WordBasic.BeginDialog 206, 108, " Enter Month"
WordBasic.Text 40, 6, 128, 13, "Enter The Month", "Text1"
WordBasic.Text 37, 26, 133, 13, "Only use 3 letters", "Text2"
WordBasic.TextBox 66, 43, 57, 18, "WORD$"
WordBasic.OKButton 45, 75, 104, 21
WordBasic.EndDialog
Dim REA As Object: Set REA = WordBasic.CurValues.UserDialog
WordBasic.CurValues.UserDialog REA
Y = WordBasic.Dialog.UserDialog(REA)
WORD$ = REA.WORD$
WORD$ = WordBasic.[RTrim$](WORD$)
WORD$ = WordBasic.[LTrim$](WORD$)
If Len(WORD$) <> 3 Then GoTo AGAIN
If BUTTON = 0 Then GoTo BYE Else
Dim DLG As Object: Set DLG = WordBasic.DialogRecord.DocumentStatistics(False)
WordBasic.CurValues.DocumentStatistics DLG
PATH$ = DLG.Directory
NAME_$ = DLG.FileName
WORD1$ = WordBasic.[Left$](NAME_$, 3)
WORD2$ = "Doc"
If WORD1$ = WORD2$ Then GoTo DATE_
GoTo ISNOT

DATE_:

WordBasic.WW7_EditGoTo "DATE"
WordBasic.Insert WORD$
GoTo START

START:



Rem YEARS = WordBasic.Year(WordBasic.Now())
Rem YEAR_$ = Str(YEARS)
Rem FILE$ = "TEMP " + " REA Sales Taxes - Dade"
Rem WordBasic.ChDefaultDir "C:\READOC Patty ", 0
Rem WordBasic.FileSaveAs Name:=FILE$, Format:=0, LockAnnot:=0, Password:="",
AddToMru:=1, WritePassword:="", RecommendReadOnly:=0, EmbedFonts:=0,
NativePictureFormat:=0, FormsData:=0, SaveAsAOCELetter:=0
Rem WordBasic.StartOfDocument



WordBasic.BeginDialog 310, 124, " REA Monthly Sales Tax"
WordBasic.Text 10, 6, 89, 13, "Invoice No.", "Text1"
WordBasic.TextBox 10, 22, 160, 18, "INVOICE$"
WordBasic.Text 10, 46, 119, 13, "Invoice Amount", "Text2"
WordBasic.TextBox 10, 62, 160, 18, "AMOUNT$"
WordBasic.CheckBox 12, 94, 96, 16, "EXEMPT", "CheckBox1"
WordBasic.OKButton 213, 20, 88, 21
WordBasic.CancelButton 213, 44, 88, 21
WordBasic.EndDialog
Set REA = WordBasic.CurValues.UserDialog
Set REA = WordBasic.CurValues.UserDialog
WordBasic.WW7_EditGoTo "INVOICE"
WordBasic.LineDown
WordBasic.StartOfLine
On Error GoTo -1: On Error GoTo ADIOS
If Asc(WordBasic.[SELECTION$]()) = 13 Then
GoTo START3
Else
GoTo AGAINII

START3:

WordBasic.WW7_EditGoTo "INVOICE"
WordBasic.LineDown
X = WordBasic.Dialog.UserDialog(REA)
If X = 0 Then GoTo ENDING
WordBasic.CurValues.UserDialog REA
INVOICE$ = REA.INVOICE$
AMOUNT$ = REA.AMOUNT$
BUTTOM1 = REA.CheckBox1
FOUND = -1
WordBasic.EditFind Find:=INVOICE$
If FOUND = WordBasic.EditFindFound() Then GoTo FOUND
WordBasic.BeginDialog 310, 124, " IS THIS CORRECT"
WordBasic.Text 10, 6, 89, 13, "Invoice No.", "Text1"
WordBasic.TextBox 10, 22, 160, 18, "INVOICE$"
WordBasic.Text 10, 46, 119, 13, "Invoice Amount", "Text2"
WordBasic.TextBox 10, 62, 160, 18, "AMOUNT$"
WordBasic.CheckBox 12, 94, 96, 16, "EXEMPT", "CheckBox1"
WordBasic.OKButton 213, 20, 88, 21
WordBasic.CancelButton 213, 44, 88, 21
WordBasic.EndDialog
Set REA = WordBasic.CurValues.UserDialog
Set REA = WordBasic.CurValues.UserDialog
REA.INVOICE$ = INVOICE$
REA.AMOUNT$ = AMOUNT$
REA.CheckBox1 = BUTTOM1
X = WordBasic.Dialog.UserDialog(REA)
If X = 0 Then GoTo ENDING
WordBasic.CurValues.UserDialog REA
INVOICE$ = REA.INVOICE$
AMOUNT$ = REA.AMOUNT$
BUTTOM1 = REA.CheckBox1
If BUTTOM1 = 1 Then GoTo EXEMPT
WordBasic.Insert INVOICE$
WordBasic.nextCell
WordBasic.nextCell
WordBasic.MailMergeInsertSet Name:="AMOUNT", ValueText:=AMOUNT$
WordBasic.TableFormula Formula:="=AMOUNT+0", NumFormat:="###,##0.00"
WordBasic.nextCell
TAX_$ = Str(TAX)
WordBasic.MailMergeInsertSet Name:="AMOUNT", ValueText:=AMOUNT$
WordBasic.MailMergeInsertSet Name:="TAX", ValueText:=TAX_$
WordBasic.TableFormula Formula:="=AMOUNT*TAX", NumFormat:="###,##0.00"
WordBasic.nextCell
WordBasic.TableFormula Formula:="=SUM(left)", NumFormat:=" ###,##0.00 "
WordBasic.nextCell

Rem Insert BLANK$

WordBasic.TableFormula Formula:="=0", NumFormat:="###,##0.00"
WordBasic.WW7_EditGoTo "AMOUNT_TOTALS"
WordBasic.LineUp
WordBasic.TableFormula Formula:="=C4+C3", NumFormat:="###,##0.00"
WordBasic.LineDown
WordBasic.SelectCurWord
WordBasic.EditCut
WordBasic.TableFormula Formula:="=C2", NumFormat:="###,##0.00"
WordBasic.LineUp
WordBasic.SelectCurWord
WordBasic.EditCut
WordBasic.LineDown
Rem TableFormula .Formula = "=SUM(BELOW)", .NumFormat = " $##,##0.00 "
WordBasic.nextCell
WordBasic.LineUp
WordBasic.TableFormula Formula:="=D4+D3", NumFormat:="###,##0.00"
WordBasic.LineDown
WordBasic.SelectCurWord
WordBasic.EditCut
WordBasic.TableFormula Formula:="=D2", NumFormat:="###,##0.00"
WordBasic.LineUp
WordBasic.SelectCurWord
WordBasic.EditCut
WordBasic.LineDown
Rem TableFormula .Formula = "=SUM(BELOW)", .NumFormat = " $##,##0.00 "
WordBasic.nextCell
WordBasic.TableFormula Formula:="=(C3+D3)", NumFormat:=" $##,##0.00 "
WordBasic.nextCell
WordBasic.LineUp
WordBasic.TableFormula Formula:="=F4+F3", NumFormat:="###,##0.00"
WordBasic.LineDown
WordBasic.SelectCurWord
WordBasic.EditCut
WordBasic.TableFormula Formula:="=F2", NumFormat:="###,##0.00"
WordBasic.LineUp
WordBasic.SelectCurWord
WordBasic.EditCut
WordBasic.LineDown
Rem TableFormula .Formula = "=SUM(BELOW)", .NumFormat = " $##,##0.00 "
WordBasic.nextCell
WordBasic.TableFormula Formula:="=(E3+F3)", NumFormat:=" $##,##0.00 "
BUTTON = WordBasic.MsgBox("DO YOU WANT TO STOP?", " MONTHLY SALES TAX",
260)
If BUTTON = 0 Then GoTo NEWROW
GoTo ERNIE

FOUND:

WordBasic.MsgBox " THIS INVOICE IS A DUPLICATE"
GoTo START3

EXEMPT:

WordBasic.Insert INVOICE$
WordBasic.nextCell
WordBasic.nextCell
WordBasic.Insert BLANK_$
WordBasic.nextCell
WordBasic.Insert BLANK_$
WordBasic.nextCell
WordBasic.Insert BLANK_$
WordBasic.WW7_EditGoTo "EXEM"
WordBasic.LineDown
WordBasic.LineDown
WordBasic.MailMergeInsertSet Name:="AMOUNT", ValueText:=AMOUNT$
WordBasic.TableFormula Formula:="=AMOUNT+0", NumFormat:="###,##0.00"
WordBasic.LineUp
WordBasic.LineUp
WordBasic.TableFormula Formula:="=F4+F3", NumFormat:="###,##0.00"
WordBasic.LineDown
WordBasic.SelectCurWord
WordBasic.EditCut
WordBasic.TableFormula Formula:="=F2", NumFormat:="###,##0.00"
WordBasic.LineUp
WordBasic.SelectCurWord
WordBasic.EditCut
WordBasic.LineDown
Rem TableFormula .Formula = "=SUM(BELOW)", .NumFormat = " $##,##0.00 "
WordBasic.nextCell
WordBasic.TableFormula Formula:="=(E3+F3)", NumFormat:=" $##,##0.00 "
BUTTON = WordBasic.MsgBox("DO YOU WANT TO STOP?", " MONTHLY SALES TAX",
260)
If BUTTON = 0 Then GoTo NEWROW
GoTo ERNIE

BYE:

Set DLG = WordBasic.DialogRecord.DocumentStatistics(False)
WordBasic.CurValues.DocumentStatistics DLG
PATH$ = DLG.Directory
NAME_$ = DLG.FileName
WORD1$ = WordBasic.[Left$](NAME_$, 3)
If WORD1$ = WORD$ Then GoTo CONT:
GoTo WRONG

CONT:

WordBasic.WW7_EditGoTo "INVOICE"
WordBasic.LineDown
WordBasic.StartOfLine
If Asc(WordBasic.[SELECTION$]()) = 13 Then GoTo START
WordBasic.LineUp
WordBasic.EndOfRow
WordBasic.nextCell
WordBasic.TableInsertRow
GoTo CHECK

CHECK:
If Asc(WordBasic.[SELECTION$]()) = 13 Then GoTo START
WordBasic.LineUp
GoTo CHECK
WordBasic.TableInsertRow
GoTo START

AGAIN:


WordBasic.MsgBox "THE NAME IS NOT A 3 LETTER WORD"
GoTo ENDING
Line:
WordBasic.LineDown return_
AGAINII:
WordBasic.MsgBox " THERE IS ALREADY INVOICE NUMBER THERE, CHECK IT "
GoTo ENDING
ERNIE:

Rem BUTTON = MsgBox("DO YOU WANT TO PRINT THIS DOCUMENT?", " MONTHLY
SALES TAX", 260)
WordBasic.WW7_EditGoTo "INVOICE"
WordBasic.TableSelectColumn
WordBasic.TableSort DontSortHdr:=0, FieldNum:="Column 1", Type:=1, Order:=0,
FieldNum2:="", Type2:=0, Order2:=0, FieldNum3:="", Type3:=0, Order3:=0,
Separator:=0, SortColumn:=0, CaseSensitive:=0
Rem If BUTTON = 0 Then Goto ADIOS
Rem FilePrint .AppendPrFile = 0, .Range = "0", .PrToFileName = "", .From =
"", .To = "", .Type = 0, .NumCopies = "1", .Pages = "", .Order = 0,
..PrintToFile = 0, .Collate = 1, .FileName = ""
GoTo ADIOS
Rem ADD A NEW ROW

NEWROW:

WordBasic.nextCell
WordBasic.TABLESELECTROW
WordBasic.TableInsertRow
GoTo START

ADIOS:

Rem SAVING FILE
YEARS = WordBasic.Year(WordBasic.Now())
YEAR_$ = Str(YEARS)
FILE$ = WORD$ + " REA Sales Taxes - Dade"
WordBasic.ChDefaultDir "M:\READOC", 0
WordBasic.FileSaveAs Name:=FILE$, Format:=0, LockAnnot:=0, Password:="",
AddToMru:=1, WritePassword:="", RecommendReadOnly:=0, EmbedFonts:=0,
NativePictureFormat:=0, FormsData:=0, SaveAsAOCELetter:=0
WordBasic.StartOfDocument
GoTo ENDING

WRONG:

WordBasic.MsgBox " YOU ARE WORKING IN THE WRONG MONTH, CHECK IT "
GoTo ENDING

ISNOT:

WordBasic.MsgBox " YOU ARE WORKING IN THE WRONG DOCUMENT, CHECK IT "
GoTo ENDING

ENDING:

End If
End Sub
 
J

Jonathan West

That's quite a lot of code. If you are already familiar with VB.NET I would
advise that you dump this code altogether, decide what you want to achieve,
and write it in VB.NET from scratch.

But I suspect that you don't really want it in VB.NET, but rather in VBA, in
the same template you took this code from to paste here. beware, the two
languages aren't at all the same

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

WordBasic to VBA said:
I'm getting wrong values for the variables for the month in this snippet
of
codes. This is WordBasic code and when I open the program program in word
2007 on a different computer it's telling me I'm working in the wrong
month
or I'm working in the wrong ducoment. Yes I converted it. Can you please
help me. Thank you for looking at it. I would like to know how to put it
into
Visual basic .net.


WordBasic.StartOfDocument
BUTTON = WordBasic.MsgBox("IS THIS A NEW DOCUMENT ?", " MONTHLY SALES
TAX", 260)

WordBasic.BeginDialog 206, 108, " Enter Month"
WordBasic.Text 40, 6, 128, 13, "Enter The Month", "Text1"
WordBasic.Text 37, 26, 133, 13, "Only use 3 letters", "Text2"
WordBasic.TextBox 66, 43, 57, 18, "WORD$"
WordBasic.OKButton 45, 75, 104, 21
WordBasic.EndDialog
Dim REA As Object: Set REA = WordBasic.CurValues.UserDialog
WordBasic.CurValues.UserDialog REA
Y = WordBasic.Dialog.UserDialog(REA)
WORD$ = REA.WORD$
WORD$ = WordBasic.[RTrim$](WORD$)
WORD$ = WordBasic.[LTrim$](WORD$)
If Len(WORD$) <> 3 Then GoTo AGAIN
If BUTTON = 0 Then GoTo BYE Else
Dim DLG As Object: Set DLG =
WordBasic.DialogRecord.DocumentStatistics(False)
WordBasic.CurValues.DocumentStatistics DLG
PATH$ = DLG.Directory
NAME_$ = DLG.FileName
WORD1$ = WordBasic.[Left$](NAME_$, 3)
WORD2$ = "Doc"
If WORD1$ = WORD2$ Then GoTo DATE_
GoTo ISNOT

DATE_:

WordBasic.WW7_EditGoTo "DATE"
WordBasic.Insert WORD$
GoTo START

START:



Rem YEARS = WordBasic.Year(WordBasic.Now())
Rem YEAR_$ = Str(YEARS)
Rem FILE$ = "TEMP " + " REA Sales Taxes - Dade"
Rem WordBasic.ChDefaultDir "C:\READOC Patty ", 0
Rem WordBasic.FileSaveAs Name:=FILE$, Format:=0, LockAnnot:=0,
Password:="",
AddToMru:=1, WritePassword:="", RecommendReadOnly:=0, EmbedFonts:=0,
NativePictureFormat:=0, FormsData:=0, SaveAsAOCELetter:=0
Rem WordBasic.StartOfDocument



WordBasic.BeginDialog 310, 124, " REA Monthly Sales Tax"
WordBasic.Text 10, 6, 89, 13, "Invoice No.", "Text1"
WordBasic.TextBox 10, 22, 160, 18, "INVOICE$"
WordBasic.Text 10, 46, 119, 13, "Invoice Amount", "Text2"
WordBasic.TextBox 10, 62, 160, 18, "AMOUNT$"
WordBasic.CheckBox 12, 94, 96, 16, "EXEMPT", "CheckBox1"
WordBasic.OKButton 213, 20, 88, 21
WordBasic.CancelButton 213, 44, 88, 21
WordBasic.EndDialog
Set REA = WordBasic.CurValues.UserDialog
Set REA = WordBasic.CurValues.UserDialog
WordBasic.WW7_EditGoTo "INVOICE"
WordBasic.LineDown
WordBasic.StartOfLine
On Error GoTo -1: On Error GoTo ADIOS
If Asc(WordBasic.[SELECTION$]()) = 13 Then
GoTo START3
Else
GoTo AGAINII

START3:

WordBasic.WW7_EditGoTo "INVOICE"
WordBasic.LineDown
X = WordBasic.Dialog.UserDialog(REA)
If X = 0 Then GoTo ENDING
WordBasic.CurValues.UserDialog REA
INVOICE$ = REA.INVOICE$
AMOUNT$ = REA.AMOUNT$
BUTTOM1 = REA.CheckBox1
FOUND = -1
WordBasic.EditFind Find:=INVOICE$
If FOUND = WordBasic.EditFindFound() Then GoTo FOUND
WordBasic.BeginDialog 310, 124, " IS THIS CORRECT"
WordBasic.Text 10, 6, 89, 13, "Invoice No.", "Text1"
WordBasic.TextBox 10, 22, 160, 18, "INVOICE$"
WordBasic.Text 10, 46, 119, 13, "Invoice Amount", "Text2"
WordBasic.TextBox 10, 62, 160, 18, "AMOUNT$"
WordBasic.CheckBox 12, 94, 96, 16, "EXEMPT", "CheckBox1"
WordBasic.OKButton 213, 20, 88, 21
WordBasic.CancelButton 213, 44, 88, 21
WordBasic.EndDialog
Set REA = WordBasic.CurValues.UserDialog
Set REA = WordBasic.CurValues.UserDialog
REA.INVOICE$ = INVOICE$
REA.AMOUNT$ = AMOUNT$
REA.CheckBox1 = BUTTOM1
X = WordBasic.Dialog.UserDialog(REA)
If X = 0 Then GoTo ENDING
WordBasic.CurValues.UserDialog REA
INVOICE$ = REA.INVOICE$
AMOUNT$ = REA.AMOUNT$
BUTTOM1 = REA.CheckBox1
If BUTTOM1 = 1 Then GoTo EXEMPT
WordBasic.Insert INVOICE$
WordBasic.nextCell
WordBasic.nextCell
WordBasic.MailMergeInsertSet Name:="AMOUNT", ValueText:=AMOUNT$
WordBasic.TableFormula Formula:="=AMOUNT+0", NumFormat:="###,##0.00"
WordBasic.nextCell
TAX_$ = Str(TAX)
WordBasic.MailMergeInsertSet Name:="AMOUNT", ValueText:=AMOUNT$
WordBasic.MailMergeInsertSet Name:="TAX", ValueText:=TAX_$
WordBasic.TableFormula Formula:="=AMOUNT*TAX", NumFormat:="###,##0.00"
WordBasic.nextCell
WordBasic.TableFormula Formula:="=SUM(left)", NumFormat:=" ###,##0.00 "
WordBasic.nextCell

Rem Insert BLANK$

WordBasic.TableFormula Formula:="=0", NumFormat:="###,##0.00"
WordBasic.WW7_EditGoTo "AMOUNT_TOTALS"
WordBasic.LineUp
WordBasic.TableFormula Formula:="=C4+C3", NumFormat:="###,##0.00"
WordBasic.LineDown
WordBasic.SelectCurWord
WordBasic.EditCut
WordBasic.TableFormula Formula:="=C2", NumFormat:="###,##0.00"
WordBasic.LineUp
WordBasic.SelectCurWord
WordBasic.EditCut
WordBasic.LineDown
Rem TableFormula .Formula = "=SUM(BELOW)", .NumFormat = " $##,##0.00 "
WordBasic.nextCell
WordBasic.LineUp
WordBasic.TableFormula Formula:="=D4+D3", NumFormat:="###,##0.00"
WordBasic.LineDown
WordBasic.SelectCurWord
WordBasic.EditCut
WordBasic.TableFormula Formula:="=D2", NumFormat:="###,##0.00"
WordBasic.LineUp
WordBasic.SelectCurWord
WordBasic.EditCut
WordBasic.LineDown
Rem TableFormula .Formula = "=SUM(BELOW)", .NumFormat = " $##,##0.00 "
WordBasic.nextCell
WordBasic.TableFormula Formula:="=(C3+D3)", NumFormat:=" $##,##0.00 "
WordBasic.nextCell
WordBasic.LineUp
WordBasic.TableFormula Formula:="=F4+F3", NumFormat:="###,##0.00"
WordBasic.LineDown
WordBasic.SelectCurWord
WordBasic.EditCut
WordBasic.TableFormula Formula:="=F2", NumFormat:="###,##0.00"
WordBasic.LineUp
WordBasic.SelectCurWord
WordBasic.EditCut
WordBasic.LineDown
Rem TableFormula .Formula = "=SUM(BELOW)", .NumFormat = " $##,##0.00 "
WordBasic.nextCell
WordBasic.TableFormula Formula:="=(E3+F3)", NumFormat:=" $##,##0.00 "
BUTTON = WordBasic.MsgBox("DO YOU WANT TO STOP?", " MONTHLY SALES
TAX",
260)
If BUTTON = 0 Then GoTo NEWROW
GoTo ERNIE

FOUND:

WordBasic.MsgBox " THIS INVOICE IS A DUPLICATE"
GoTo START3

EXEMPT:

WordBasic.Insert INVOICE$
WordBasic.nextCell
WordBasic.nextCell
WordBasic.Insert BLANK_$
WordBasic.nextCell
WordBasic.Insert BLANK_$
WordBasic.nextCell
WordBasic.Insert BLANK_$
WordBasic.WW7_EditGoTo "EXEM"
WordBasic.LineDown
WordBasic.LineDown
WordBasic.MailMergeInsertSet Name:="AMOUNT", ValueText:=AMOUNT$
WordBasic.TableFormula Formula:="=AMOUNT+0", NumFormat:="###,##0.00"
WordBasic.LineUp
WordBasic.LineUp
WordBasic.TableFormula Formula:="=F4+F3", NumFormat:="###,##0.00"
WordBasic.LineDown
WordBasic.SelectCurWord
WordBasic.EditCut
WordBasic.TableFormula Formula:="=F2", NumFormat:="###,##0.00"
WordBasic.LineUp
WordBasic.SelectCurWord
WordBasic.EditCut
WordBasic.LineDown
Rem TableFormula .Formula = "=SUM(BELOW)", .NumFormat = " $##,##0.00 "
WordBasic.nextCell
WordBasic.TableFormula Formula:="=(E3+F3)", NumFormat:=" $##,##0.00 "
BUTTON = WordBasic.MsgBox("DO YOU WANT TO STOP?", " MONTHLY SALES
TAX",
260)
If BUTTON = 0 Then GoTo NEWROW
GoTo ERNIE

BYE:

Set DLG = WordBasic.DialogRecord.DocumentStatistics(False)
WordBasic.CurValues.DocumentStatistics DLG
PATH$ = DLG.Directory
NAME_$ = DLG.FileName
WORD1$ = WordBasic.[Left$](NAME_$, 3)
If WORD1$ = WORD$ Then GoTo CONT:
GoTo WRONG

CONT:

WordBasic.WW7_EditGoTo "INVOICE"
WordBasic.LineDown
WordBasic.StartOfLine
If Asc(WordBasic.[SELECTION$]()) = 13 Then GoTo START
WordBasic.LineUp
WordBasic.EndOfRow
WordBasic.nextCell
WordBasic.TableInsertRow
GoTo CHECK

CHECK:
If Asc(WordBasic.[SELECTION$]()) = 13 Then GoTo START
WordBasic.LineUp
GoTo CHECK
WordBasic.TableInsertRow
GoTo START

AGAIN:


WordBasic.MsgBox "THE NAME IS NOT A 3 LETTER WORD"
GoTo ENDING
Line:
WordBasic.LineDown return_
AGAINII:
WordBasic.MsgBox " THERE IS ALREADY INVOICE NUMBER THERE, CHECK IT "
GoTo ENDING
ERNIE:

Rem BUTTON = MsgBox("DO YOU WANT TO PRINT THIS DOCUMENT?", " MONTHLY
SALES TAX", 260)
WordBasic.WW7_EditGoTo "INVOICE"
WordBasic.TableSelectColumn
WordBasic.TableSort DontSortHdr:=0, FieldNum:="Column 1", Type:=1,
Order:=0,
FieldNum2:="", Type2:=0, Order2:=0, FieldNum3:="", Type3:=0, Order3:=0,
Separator:=0, SortColumn:=0, CaseSensitive:=0
Rem If BUTTON = 0 Then Goto ADIOS
Rem FilePrint .AppendPrFile = 0, .Range = "0", .PrToFileName = "", .From =
"", .To = "", .Type = 0, .NumCopies = "1", .Pages = "", .Order = 0,
.PrintToFile = 0, .Collate = 1, .FileName = ""
GoTo ADIOS
Rem ADD A NEW ROW

NEWROW:

WordBasic.nextCell
WordBasic.TABLESELECTROW
WordBasic.TableInsertRow
GoTo START

ADIOS:

Rem SAVING FILE
YEARS = WordBasic.Year(WordBasic.Now())
YEAR_$ = Str(YEARS)
FILE$ = WORD$ + " REA Sales Taxes - Dade"
WordBasic.ChDefaultDir "M:\READOC", 0
WordBasic.FileSaveAs Name:=FILE$, Format:=0, LockAnnot:=0, Password:="",
AddToMru:=1, WritePassword:="", RecommendReadOnly:=0, EmbedFonts:=0,
NativePictureFormat:=0, FormsData:=0, SaveAsAOCELetter:=0
WordBasic.StartOfDocument
GoTo ENDING

WRONG:

WordBasic.MsgBox " YOU ARE WORKING IN THE WRONG MONTH, CHECK IT "
GoTo ENDING

ISNOT:

WordBasic.MsgBox " YOU ARE WORKING IN THE WRONG DOCUMENT, CHECK IT "
GoTo ENDING

ENDING:

End If
End Sub
 
D

Dave

It doesn't sound like you're actually running into a coding error, there. If
you were, you'd be getting something like "Method or Data member not found".
Since it's saying you're working in the wrong month AND you're running it on
a different computer, it's more likely that the date format is set
differently on the two machines.

If one is set for MM/DD/YYYY and the other is set for DD/MM/YYYY, a date
like 09/13/2007 will be valid on the first machine, but not on the second
machine. I'd check that first.

If that's not it, narrow it down to where the error is occurring, and reply
with more specific info.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top