PDA

View Full Version : Help setting up invoice templatesi



djelectric
11-12-2016, 01:26 PM
Hi everyone. I am new to the forum and am hoping someone can help me!

I'm a self employed electrician and im trying to set up an invoicing system.

I am using MS Word 2016 Pro Plus on Windows 10 Pro.

I need my invoice templates to automatically generate a new sequential invoice number in both the filename and the document itself, every time i SAVE an invoice. At the moment i have a macro in place that will do this but automatically saves a copy of the invoice even if i decide not to type one out, or cancel one and start again. The way it is set up now it will save empty copies of my invoice template and therefore uses up an invoice number.

I just want it to act like a normal template that asks where you want to save it when you click save, but still have the auto numbering...

Also, in addition to the numbering i'd like the filename to also include the client's address that i input into the document when typing my invoices out.. currently i am just copying and pasting it into my filename which is time consuming.

this is the one and only macro i have running at the moment:

Sub AutoNew()

Order = System.PrivateProfileString("D:\Danny\Documents\Custom Office Templates\Invoice-Number.txt", _
"MacroSettings", "Order")

If Order = "" Then
Order = 1
Else
Order = Order + 1
End If

System.PrivateProfileString("D:\Danny\Documents\Custom Office Templates\Invoice-Number.txt", "MacroSettings", _
"Order") = Order

ActiveDocument.Bookmarks("Order").Range.InsertBefore Format(Order, "1600#")
ActiveDocument.SaveAs FileName:="INV" & Format(Order, "1600#")

End Sub

So ideally, the end resulting filename i would like would look like this: INV16027 - 22 Macro Street, London SE1 2AB (address to be sourced from the address field within the document/template)

I hope this makes sense and any help would be HUGELY APPRECIATED!!!! I am a complete newcomer to macros and am struggling big time!

Many thanks!

Danny.

gmaxey
11-12-2016, 02:54 PM
Before helping you build your mouse trap, have a look at mine:

http://gregmaxey.mvps.org/word_tip_pages/invoice_automated_for_word.html

djelectric
11-16-2016, 08:04 AM
Before helping you build your mouse trap, have a look at mine.

Overall looks good! But is it a possibility to implement my template/layout as i dont need a lot of the features and sections you have...

I just need the above features.. Im willing to donate some money if you could get mine working as i want?

djelectric
11-16-2016, 08:09 AM
17616

gmaxey
11-16-2016, 08:17 AM
If you want to engage me for consulting services you will need to send website feedback