Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-30-2012, 10:29 AM
cmnichol cmnichol is offline Invoice numbering on Macs Mac OS X Invoice numbering on Macs Office for Mac 2011
Novice
Invoice numbering on Macs
 
Join Date: Apr 2012
Posts: 9
cmnichol is on a distinguished road
Default Invoice numbering on Macs


I think I'm almost there. I've got the field to appear when I open a new document from a template. However, it only opens as 0000 and does not increase with each new document. I think it might be in the step where you create the Custom Property "InvNum". What "Type" does it need to be? If number, then what value should I enter?

Last edited by macropod; 03-16-2016 at 02:54 PM. Reason: Split from http://www.msofficeforums.com/word/7880-sequential-numbering-across-multiple-docs.html
Reply With Quote
  #2  
Old 04-30-2012, 03:51 PM
macropod's Avatar
macropod macropod is offline Invoice numbering on Macs Windows 7 64bit Invoice numbering on Macs Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,382
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The 'InvNum' property's type can be either Text or Number, with whatever string or number you care to input - all you need is to have something there so that Word can complete the property's creation.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-02-2012, 06:57 AM
cmnichol cmnichol is offline Invoice numbering on Macs Mac OS X Invoice numbering on Macs Office for Mac 2011
Novice
Invoice numbering on Macs
 
Join Date: Apr 2012
Posts: 9
cmnichol is on a distinguished road
Default

That makes sense, thanks. Any ideas as to why the number is not increasing?
Reply With Quote
  #4  
Old 05-02-2012, 08:08 AM
cmnichol cmnichol is offline Invoice numbering on Macs Mac OS X Invoice numbering on Macs Office for Mac 2011
Novice
Invoice numbering on Macs
 
Join Date: Apr 2012
Posts: 9
cmnichol is on a distinguished road
Default

InvoiceFile = Options.DefaultFilePath(wdStartupPath) & "\Invoice.ini" 'or, if using a Workgroup folder 'InvoiceFile = Options.DefaultFilePath(wdWorkgroupTemplatesPath) & "\Invoice.ini"

I think it might be that I needed up put my own path of where to save the Invoice.ini file.

However, now I'm trying to figure out the syntax, as it's not liking anything that I put in.

As I'm on a mac, if my path is: /Users/claire/Library/Application Support/Microsoft/Office/User Templates
Then what would I insert here. Is it the spaces in the folder file names with two words (Application Support)?

Thanks!
Reply With Quote
  #5  
Old 05-02-2012, 05:50 PM
macropod's Avatar
macropod macropod is offline Invoice numbering on Macs Windows 7 64bit Invoice numbering on Macs Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,382
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Claire,

What do you get via:
Code:
Sub Test()
MsgBox Options.DefaultFilePath(wdStartupPath)
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 05-15-2012, 08:08 AM
cmnichol cmnichol is offline Invoice numbering on Macs Mac OS X Invoice numbering on Macs Office for Mac 2011
Novice
Invoice numbering on Macs
 
Join Date: Apr 2012
Posts: 9
cmnichol is on a distinguished road
Default

Hi Paul,
This is what I get...

claire$ Sub Test()
-bash: syntax error near unexpected token `('
Claires-Production-Mac-2:~ claire$ MsgBox Options.DefaultFilePath(wdStartupPath)-bash: syntax error near unexpected token `('
Claires-Production-Mac-2:~ claire$ End Sub
Reply With Quote
  #7  
Old 05-15-2012, 03:23 PM
macropod's Avatar
macropod macropod is offline Invoice numbering on Macs Windows 7 64bit Invoice numbering on Macs Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,382
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi claire,

Whatever that is, it doesn't look anything like the result of running the macro I posted. Did you actually add the macro to a document's code module and run it? See: http://www.gmayor.com/installing_macro.htm
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #8  
Old 05-17-2012, 07:12 AM
cmnichol cmnichol is offline Invoice numbering on Macs Mac OS X Invoice numbering on Macs Office for Mac 2011
Novice
Invoice numbering on Macs
 
Join Date: Apr 2012
Posts: 9
cmnichol is on a distinguished road
Default Lost

No, I admit that I got as far as the module part, and then got a bit lost. Also, the macro for changing the color didn't work for me.

I'm definitely a LOT lost in all of this!
Reply With Quote
  #9  
Old 05-17-2012, 03:54 PM
macropod's Avatar
macropod macropod is offline Invoice numbering on Macs Windows 7 64bit Invoice numbering on Macs Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,382
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Claire,

See attached template. To use it, you should be able to just double-click on it to create a new document. The macros are in the template's 'ThisDocument' module. I've changed the name of the 'AutoNew' macro to 'Document_New) to reflect this, but that's all.

If you open the vbe and click onthe template's 'ThisDocument' module, you'll be able to see the code. Likewise, if you click on 'Advanced properties' for either the template or the document and look under 'Custom', you'll see the 'InvNum' property.
Attached Files
File Type: zip Invoice.zip (11.9 KB, 63 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #10  
Old 05-18-2012, 06:08 AM
cmnichol cmnichol is offline Invoice numbering on Macs Mac OS X Invoice numbering on Macs Office for Mac 2011
Novice
Invoice numbering on Macs
 
Join Date: Apr 2012
Posts: 9
cmnichol is on a distinguished road
Default

Thanks so much for this! I've given it a try but haven't had any luck. Could be something that I'm doing (or not doing). This is what I've tried so far...

When I double click on it from my desktop, it opens and shows the field #0000. I opened the template again and the number hadn't increased. I wondered if I needed to save the document for the macro to work, but it still didn't work. Also I've tried 'running' the macro from the macro commands.

So I thought that maybe the template needed to be in the My Templates folder and moved it there. I opened a new document from template, and went through the same steps as above, but with no success. In fact when I tried to run the macro from this location, I got the following error...

Run-time error '-2147483640 (80000008)'
Method 'PrivateProfileString' of object 'System' failed

Next I wondered if it was either something to do with a setting on my computer, or that I'm using a mac. So I tried the template from our PC (from the desktop though). This hasn't worked either.

What am I doing wrong?
Reply With Quote
  #11  
Old 05-18-2012, 06:18 AM
macropod's Avatar
macropod macropod is offline Invoice numbering on Macs Windows 7 64bit Invoice numbering on Macs Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,382
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Claire,

It's probably something to do with differences betwen PCs and Macs limiting how the code can save the numbering file used by the template.

I'll look into some other options and get back to you. I don't use or have access to a Mac, so it might take a day or three.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #12  
Old 05-18-2012, 06:54 AM
cmnichol cmnichol is offline Invoice numbering on Macs Mac OS X Invoice numbering on Macs Office for Mac 2011
Novice
Invoice numbering on Macs
 
Join Date: Apr 2012
Posts: 9
cmnichol is on a distinguished road
Default Works on the PC

I failed to notice that on the PC Word, was saying that macros were disabled. So once I turned them on, the template works, so it's definitely a Mac thing.

Yay! Progress
Reply With Quote
  #13  
Old 05-18-2012, 11:57 AM
cmnichol cmnichol is offline Invoice numbering on Macs Mac OS X Invoice numbering on Macs Office for Mac 2011
Novice
Invoice numbering on Macs
 
Join Date: Apr 2012
Posts: 9
cmnichol is on a distinguished road
Default

Hi Paul,
I found this page when looking into the different file paths in macs.
http://www.rondebruin.nl/mac.htm

I'm wondering if the answer is in the section called "Get Path of Special Folders". It gives some code there, but I'm not sure where to insert it. (It looks like VBA, but it calls it 'mac script' and 'apple script' which is very different.)
Reply With Quote
  #14  
Old 05-18-2012, 04:32 PM
macropod's Avatar
macropod macropod is offline Invoice numbering on Macs Windows 7 64bit Invoice numbering on Macs Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,382
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Claire,

The issue isn't so much as where a file might be saved, but how it is referenced. In WIndows, I can use 'System.PrivateProfileString', but that isn't supported on the Mac platform. I have found a different technique I can use on both - provided you don't need others to be able to access the sane data for creating their own invoices - but that's probably not going to be much good in a corporate environment. I'll keep looking.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #15  
Old 05-18-2012, 05:25 PM
macropod's Avatar
macropod macropod is offline Invoice numbering on Macs Windows 7 64bit Invoice numbering on Macs Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,382
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Claire,

Try the attached. I think it should work on both platforms.
Attached Files
File Type: zip Invoice.zip (10.1 KB, 20 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add a serial number to an invoice pringle747 Excel Programming 6 02-19-2015 11:19 AM
Invoice numbering on Macs automatic invoice numbering acki Excel 7 08-14-2013 08:11 PM
Invoice Statement Shoshana3 Word 0 11-15-2010 03:02 PM
Invoice numbering on Macs Invoice Number Generation mrphilk Excel 2 06-08-2010 12:39 PM
Read-Only and Not Opening on Macs luciddaydream Word 0 03-15-2010 07:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:37 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft