Needed Help with starting and insertin 
Author Message
 Needed Help with starting and insertin

Hi everybody,

i want to make a orderform for my colleagues.

This Order Form has an number who is always is one more than the last.

a friend helped me with this, because the document is *.dot-File.

The Source of the VBA now:

Private Sub CommandButton1_Click()
TextBox1 = Format(New_Num, "00000")
CommandButton1.Enabled = False
End Sub

Private Sub TextBox1_Change()

End Sub
Public Function New_Num() As Integer

'SaveSetting "Bestellung", "lfdnr", "lfdnr", 0

If IsNumeric(GetSetting("Bestellung", "lfdnr", "lfdnr")) Then
    New_Num = GetSetting("Bestellung", "lfdnr", "lfdnr")
End If

New_Num = New_Num + 1
SaveSetting "Bestellung", "lfdnr", "lfdnr", New_Num

End Function

Private Sub Werte_loeschen()

SaveSetting "Bestellung", "lfdnr", "lfdnr", 0
End Sub

So far so good...

Now what i want, is that it is automaticly added in a text box, or a
line in this word document when a new document is made.

The additional idea was, that the document will be saved automaticly
when the document will close, with the file-name of "lfdnr" (i.e.
205.doc next time 206.doc)

is it possible that somebody help me???

greetings

Nestroy



Sun, 01 Aug 2004 15:20:45 GMT  
 Needed Help with starting and insertin
Hi Nestroy,

For an example on how to do this, check
http://www.mvps.org/word/FAQs/MacrosVBA/NumberDocs.htm

Hope this helps,
regards,
Astrid

So that all can benefit from the discussion, please post all follow-ups to the newsgroup.
Visit the MVP Word FAQ site at http://www.mvps.org/word/


Quote:
> Hi everybody,

> i want to make a orderform for my colleagues.

> This Order Form has an number who is always is one more than the last.

> a friend helped me with this, because the document is *.dot-File.

> The Source of the VBA now:

> Private Sub CommandButton1_Click()
> TextBox1 = Format(New_Num, "00000")
> CommandButton1.Enabled = False
> End Sub

> Private Sub TextBox1_Change()

> End Sub
> Public Function New_Num() As Integer

> 'SaveSetting "Bestellung", "lfdnr", "lfdnr", 0

> If IsNumeric(GetSetting("Bestellung", "lfdnr", "lfdnr")) Then
>     New_Num = GetSetting("Bestellung", "lfdnr", "lfdnr")
> End If

> New_Num = New_Num + 1
> SaveSetting "Bestellung", "lfdnr", "lfdnr", New_Num

> End Function

> Private Sub Werte_loeschen()

> SaveSetting "Bestellung", "lfdnr", "lfdnr", 0
> End Sub

> So far so good...

> Now what i want, is that it is automaticly added in a text box, or a
> line in this word document when a new document is made.

> The additional idea was, that the document will be saved automaticly
> when the document will close, with the file-name of "lfdnr" (i.e.
> 205.doc next time 206.doc)

> is it possible that somebody help me???

> greetings

> Nestroy



Tue, 03 Aug 2004 05:34:09 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. insertin picture into access database with sql !

2. Insertin Menus and SubMenus VBe5

3. insertin picture onto power point 97 slide

4. URGENT--Need help starting excel macro from access

5. HELP NEEDED: Access 95 DAO Error - Won't Start, Access Quits

6. Need help getting started on first module

7. Help needed to start another processs !

8. Starting to use Forms Need Help

9. Need help on direction to start looking

10. Just getting started, and need help...

11. just starting with ASP and need help with code

12. Need help starting PAC MAN game

 

 
Powered by phpBB® Forum Software