Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-25-2013, 01:01 AM
ssarank ssarank is offline Generate sequential code tags Windows 8 Generate sequential code tags Office 2003
Novice
Generate sequential code tags
 
Join Date: Dec 2013
Posts: 2
ssarank is on a distinguished road
Question Generate sequential code tags

Hi,
How generate the sequence id for existing number
Example :


<img id="img001" src=""/>
<img id="img001" src=""/>
<img id="img001" src=""/>
i need for below format :
<img id="img002" src=""/>
<img id="img003" src=""/>
<img id="img004" src=""/>
Reply With Quote
  #2  
Old 12-25-2013, 01:11 AM
macropod's Avatar
macropod macropod is offline Generate sequential code tags Windows 7 32bit Generate sequential code tags Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,950
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 ssarank,

It's not at all clear what you are starting with and what you want to do with whatever your starting data are.

PS: Please don't add new topics to existing threads - I've split your post off to a new thread.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 12-25-2013, 02:02 AM
ssarank ssarank is offline Generate sequential code tags Windows 8 Generate sequential code tags Office 2003
Novice
Generate sequential code tags
 
Join Date: Dec 2013
Posts: 2
ssarank is on a distinguished road
Default How to generate automatick number sequence

[QUOTE=ssarank;56407]Hi,
The default the word document content is this below format:
Example :
<img id="img001" src=""/>
<img id="img001" src=""/>
<img id="img001" src=""/>
<img id="img001" src=""/>

i need replace then 001 number is replace order number :
<img id="img001" src=""/>
<img id="img002" src=""/>
<img id="img003" src=""/>
<img id="img004" src=""/>
Reply With Quote
  #4  
Old 12-25-2013, 02:44 AM
macropod's Avatar
macropod macropod is offline Generate sequential code tags Windows 7 32bit Generate sequential code tags Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,950
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

You could do that with a macro like:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "<img id=" & Chr(34) & "img001" & Chr(34) & " src=" & Chr(34) & Chr(34) & "/>"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    .Execute
  End With
  Do While .Find.Found
    i = i + 1
    .Start = .Start + 12
    .End = .Start + 3
    .Text = Format(i, "000")
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
Application.ScreenUpdating = True
MsgBox i & " tags found."
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generate sequential code tags Generate TOC Without Paragraph Text sbianco Word 8 09-22-2012 06:54 AM
Generate sequential code tags Viewing Bookmark Tags namedujour Word 2 08-13-2012 09:02 PM
Generate sequential code tags For Moderator: Code tags? Ulodesk Forum Support 1 07-12-2011 07:54 AM
Generate tree structure, tool? Troddel PowerPoint 0 10-13-2010 11:41 PM
Generate Folder streng Excel 0 11-11-2008 11:20 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:35 PM.


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