To place the number in a specific position (this macro adds at the very beginning of the page), create a bookmark in the template named Invoice then use this code to insert the number:ĪctiveDocument.Bookmarks("Invoice").Range. :=False, SaveAsAOCELetter:=False, CompatibilityMode:=14 , FileFormat:=wdFormatXMLDocument, LockComments:=False, Password:="", _ĪddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _ĮmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _ "C:\Users\user\Documents\a\inv" & Format(Invoice, "#") & ".docx" _ "invoice-number.txt", "InvoiceNumber", "Invoice") = InvoiceĪ Format(Invoice, "#") System.PrivateProfileString("C:\Users\user\Documents\a\" & _ "invoice-number.txt", "InvoiceNumber", "Invoice") Invoice = System.PrivateProfileString("C:\Users\user\Documents\a\" & _ Step 3: Expand Microsoft Word Documents then double click on ThisDocument. Step 2: Open Word then press Alt+F11 to open the VB Editor. To start with a specific number, add this to the text file and save, using one less than the desired number. Create a text file named invoice-number.txt in the folder. Step 1: Create a folder on your hard drive. This very simple macro adds a number to a document and saves with the file name in the format of "inv1.docx", creating a very simple numbering system for invoices.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |