Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-14-2011, 01:41 PM
jdwoods jdwoods is offline Sequential  Numbering Windows XP Sequential  Numbering Office 2003
Novice
Sequential  Numbering
 
Join Date: Dec 2011
Posts: 4
jdwoods is on a distinguished road
Default Sequential Numbering

I found a macro from the thread Titled "How do I do a sequential number?" and when tired to format it to a word document that i was making i can not seem to get it to work like the way I thought it would work, even the text boxes will not work but when i run the macro i don't get any errors. I have included the file to see if anyone could help me out. All I want is the macro to do is to change the numbering on top of the page every time a print a new page or the i can print 1 to 500 pages and that the number sequence will be displayed on the top of the page.
Attached Files
File Type: docx Elevator Inventory Control Ticket 1.docx (16.5 KB, 22 views)
Reply With Quote
  #2  
Old 12-14-2011, 02:56 PM
macropod's Avatar
macropod macropod is offline Sequential  Numbering Windows 7 64bit Sequential  Numbering Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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 jdwoods,

There's no macro in your document (it's in docx format), so it's hard to see what the issue might be. Perhaps you could post one with the code.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 12-14-2011, 03:02 PM
jdwoods jdwoods is offline Sequential  Numbering Windows XP Sequential  Numbering Office 2003
Novice
Sequential  Numbering
 
Join Date: Dec 2011
Posts: 4
jdwoods is on a distinguished road
Default

Code:
Option Explicit
Sub ElevatorInventoryControlTicket()
Dim iStart As Integer, iEnd As Integer, i As Integer
On Error GoTo ErrHandler
With ActiveDocument.Shapes(1).TextFrame.TextRange.Fields(1)
iStart = CInt(InputBox("What is the first certificate to print?", "Print Certificates From", Split(Split(.Code.Text, "")(0), "=")(1)))
iEnd = CInt(InputBox("What is the last Certificate to print?", "Print Certificates To", iStart))
If iStart = 0 Or iStart > iEnd Then Exit Sub
For i = iStart To iEnd
.Code.Text = "=" & i & " \#0"
.Update
ActiveDocument.PrintOut
Next
End With
ErrHandler:

End Sub
This is the code that I am using.
Reply With Quote
  #4  
Old 12-14-2011, 03:12 PM
macropod's Avatar
macropod macropod is offline Sequential  Numbering Windows 7 64bit Sequential  Numbering Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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 jdwoods,

Because your document has two textboxes, and the one with the counter was inserted last, you need to change 'Shapes(1)' to 'Shapes(2)'.

You also need to change '.Code.Text, ""' to '.Code.Text, " "'.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 12-14-2011, 03:45 PM
jdwoods jdwoods is offline Sequential  Numbering Windows XP Sequential  Numbering Office 2003
Novice
Sequential  Numbering
 
Join Date: Dec 2011
Posts: 4
jdwoods is on a distinguished road
Default

I do not see the difference between 'code.text,"" to 'Code.text, "". if the period is suppose to follow the brackets on the second one then i get an error.
Reply With Quote
  #6  
Old 12-14-2011, 04:06 PM
macropod's Avatar
macropod macropod is offline Sequential  Numbering Windows 7 64bit Sequential  Numbering Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Quote:
Originally Posted by jdwoods View Post
I do not see the difference between 'code.text,"" to 'Code.text, "".
That's because you're not paying attention to the space between the double quotes.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 12-15-2011, 01:11 PM
jdwoods jdwoods is offline Sequential  Numbering Windows XP Sequential  Numbering Office 2003
Novice
Sequential  Numbering
 
Join Date: Dec 2011
Posts: 4
jdwoods is on a distinguished road
Default

I tired rewriting the whole marco in a new file and still can not get the input boxes to appear and therefore the ticket number does not change not sure what am doing wrong. Could it be the verision of word i am using or am i missing a simple step when i am running the macro.
Reply With Quote
  #8  
Old 12-16-2011, 05:11 AM
macropod's Avatar
macropod macropod is offline Sequential  Numbering Windows 7 64bit Sequential  Numbering Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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 jdwoods,

See the attached.
Attached Files
File Type: zip Elevator Inventory Control Ticket.zip (27.7 KB, 47 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sequential  Numbering Sequential numbering across multiple docs mslearner Word 18 06-12-2019 04:00 AM
Sequential  Numbering How do I do a Sequential Numbering? gburya Word VBA 26 07-04-2017 03:29 PM
Sequential  Numbering Sequential Page Numbering of Multiple Word Docs bobmard Word 8 08-24-2011 08:51 AM
Sequential Presentations GSmoot PowerPoint 0 07-12-2011 11:20 AM
Sequential  Numbering Subtotaling Sequential 0's ktpalmer Excel 2 06-23-2010 06:54 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:17 AM.


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