Dual page numbering and TOC
Per article 291283 "seq method", how do I set correct page numbering for the
TOC? Tag: Dual page numbering and TOC Tag: 61344
WordBasic.Call to function in a module?
I've got a .dot file on a pc here at the office that is used via Word (i.e.
File | New ) to create a document based upon some data in an access database
located on a network share that all PCs have a drive mapped to. The
original developer is no longer here and I'm trying to move that .dot file
to another PC so the user there can use it. So, I copied the .dot file to
the same templates folder on the other PC. When I run the code, I get an
error that the "Object doesn't support this property of method".
I click the debug button and an instance of the VB editor launches and I see
that the problem is in a call to WordBasic.Call. The problem is the first
parameter. It is referencing a procedure in a module in argument is in the
form of "mymod.someprocedure$". I know this is something that we coded
in-house because of the name of mymod and the context of the call (it's
calculating something specific to our business).
I assume the file, etc. that contains the code that WordBasic.Call is trying
to call is on the old PC, but I just don't know what I should be looking
for. So, what I'm trying to figure out is, in the VBA world, what form does
a "module" take and how is it referenced by the vba code and/or the .dot
file. Any help I could get to make this .dot work on the other PC would be
much appreciated.
Thanks! Tag: Dual page numbering and TOC Tag: 61339
Open a web page from vba
How do I open a webpage from vba? I can't quite get the Shell syntax to
work for this.
Thanks.
Larry Tag: Dual page numbering and TOC Tag: 61338
Corrupted Table Error Message
When I open a document I receive an error message regarding a corrupted table
I am trying to delete the corrupted table. I canâ??t even see the table but
the following line reveals that I have 2 in a document:
ActiveDocument.Tables.Count
When I use code to go to the table: ActiveDocument.Tables.items(1).select, I
move to down about 20 pages to the table. I canâ??t see the table but ASSUME
that it is selected. If I try ActiveDocument.Tables.items(1).delete then the
table is not deleted.
Any thought?
Thanks in advance,
Stewart Rogers Tag: Dual page numbering and TOC Tag: 61337
Create Sequential Dates
Hello Teachers,
Today I spent some time trying to come up with a way to enter a
sequence of dates in a document. Basically the OP had an Itenerary
Day 1 Jan 07, 2005
Day 2 Jan 08, 2005
etc.
I posted a solution where the user would run a macro to create a
collection of numbered DocVariables each storing the next days date.
Then in the document I inserted DocVariable fields with nested Quote
and Seq fields.
Day {Seq Date} { DocVariable{ Quote Var{ Seq dayNum }}
Day {Seq Date} { DocVariable{ Quote Var{ Seq dayNum }}
etc.
The macro to create the DocVariables follows:
Sub DateSeq()
Dim myDate As Date
Dim dayNum As Long
Dim numDays As Long
myDate = InputBox("Enter the start date in 1/31/2005 format.", "Start
On", Date)
numDays = InputBox("Enter the sequence length in days.", "Sequence
Length", "14")
For dayNum = 0 To numDays
ActiveDocument.Variables("Var" & dayNum).Value = Format(myDate +
dayNum - 1, "dddd, mmm d yyyy")
Next
ActiveDocument.Fields.Update
End Sub
I looked through the Google data base for anything close and didn't
seeing anything. This seems to work, but I am to declare victory. I
would appreaciate any comments on this method or suggestions for a
better method.
Thanks Tag: Dual page numbering and TOC Tag: 61336
Can I use a combo box without locking the document?
This is because, I want to set up a template and use a combo box, but if I
lock the document, I won't be able to write in it.
Thanks Tag: Dual page numbering and TOC Tag: 61333
Not stopping at breakpoint - upgrading from Word 97 to 2003
We're upgrading from Word 97 to Word 2003. In 97 I could open a template,
open the vb editor, make some changes in the code, (not saving them in case
they were incorrect), put in some breakpoints, then go to File/New/General/
select my template, test run the macro and it would stop at my set
breakpoints. When I test a macro in 2003, it doesn't stop at the set
breakpoint. It's like it's opening the saved version of the macro instead of
running the one I already have open. I don't want to just hit run because I
don't want the macro to insert data into my master template. Is there some
setting that needs to be changed in Word 2003 that I'm missing?
Thanks for your help Tag: Dual page numbering and TOC Tag: 61331
getting date & time of a file from web site?
Hi Folks,
How can I get the date and time of a file from a website? Say I wanted
to know the last time my site pages were updated, I'd use something like:
FileDateTime("http://www.mysite.com/index.html")
Any Ideas?
Cheers
JohnnyB Tag: Dual page numbering and TOC Tag: 61327
reducing font of a bookmark field
I'd like to add some code that would check to see if the text of a bookmark
field is two lines (containing a paragraph mark) and if it is, then to reduce
the font of all those bookmarks to 10 point so it will fit in the allotted
space in my form. Thanks, charlie Tag: Dual page numbering and TOC Tag: 61325
vba template- macro security setting problem...
Hi,
g'd morning. i have a word xp template which has active objs. it is working
fine on all computers except a single user. the user has windows xp with sp 2
and office xp installed vs. windows xp with sp 1 on all other machines. it
has icons linked to macros which pop up vb forms. as soon as i click the
icons, i got the "the macro can't be found or has been disabled because of
your macor security setting". then, the template crashed with 0x8000FFF
catastrophic failure error. does anyone has any experience with that?
thank you,
will
-- Tag: Dual page numbering and TOC Tag: 61324
saving text
Here's my question....is it possible to write into a Word
macro:
copy text|open wordpad|paste text|save as Text.txt (to
desktop)|close
Wordpad|close Word active document.
I'm having an issue that this would solve entirely but I
dont know if its possible to
involve another program in a Word macro. Tag: Dual page numbering and TOC Tag: 61323
Get *.doc and *.rtf files in 1 folder listed on a UserForm?
Is it possible to get all *doc and *.rtf files in a selected folder on a
user form in Word XP?
Any idea how I could tackle this problem? Or are there any examples
around from which i could copy and paste the structure?
*Background info: Some of the files will be selected on the user form by
the user. Also, the user will set only one of the files as the "main
file". Only selected files will be processed by another macro. The main
file will be processed differently. The files should be displayed on the
form with radio buttons.
Ciao,
ANDy Tag: Dual page numbering and TOC Tag: 61314
Tools for creating application to integrate with Word
Hi, I'm going to write a program that is to be integrated with word and I
don't quite know where to start. I've been fiddling with VBA for a while but
there are too many limitations. I need to know what tools will make the task
easier.
- It should be possible to fire via a word toolbar.
- I need to use functions that are obviously used internally by Word but
that I can't find in the VBA docs, like the _correct_ word count as opposed
to the one described in the docs that counts newlines and punctuation. I can
write my own, but prefer to use what already exists.
- I need to package the program nicely so it's easy to install.
What tool(s) will be more helpful? Should I go with .NET? Which programming
language? I know C++ well, and some VBA. Perhaps C#?
Any pointers will be greatly appreciated!
Thanks :-) Tag: Dual page numbering and TOC Tag: 61313
Changing Styles
This is crazy. I am trying to change the style "COOL" in the document to
another style called "NOTSOCOOL". I wrote this:
With ActiveDocument.Range.Find
.Style = "COOL"
.ClearFormatting
.MatchWildcards = False
With .Replacement
.Style = "NOTSOCOOL"
End With
.Execute Replace:=wdReplaceAll
End With
Doesn't work! I am positive that nothing extra is set, the same code (when
.style is removed and .text is added) finds and replaces words with no
problems. The styles definitely exist and I did a manual Find and Replace
(Edit - Find) and it works fine.
What's wrong with the code?
Thank you for your time / response
Vince Tag: Dual page numbering and TOC Tag: 61301
Limits in Heading Numbered paragraphs and cross references
Anybody know of "documentation" of the apparent limits in Word(97, 2000,
2002. 2003) that apply to heading numbering. I used Word 2003 for the
following.
I tried to find out how many heading numbered paragraphs could be contained
in a single document.
So I wrote a little macro to keep generating paragraphs, each consisting of
only the counter.
I interrupted the macro when the count got to a bit under 36000. I then
applied the Heading 1 style to the whole document.
So each paragraph is numbered from 1 to the number of paragraphs and the
text of the paragraph is the same as the paragraph number.
I then used the Insert | References menu to insert a reference, initially
using the /h option.
I was able to successfully insert a reference to the number of the last
paragraph, however, when I almost immediately followed that by attempting to
insert a reference to the paragraph's text, the cross reference inserted was
to an entirely different paragraph.
I tried a few more insertions, eventually getting to the point where the
incorrect cross reference was always inserted, and finally to a point where
the Insert Cross Reference dialog, in effect, blew up. Ultimately, an
attempt to insert a reference to the later paragraphs, caused things to hang
AND the first 32767 items disappeared from the list of headings in the cross
reference dialog.
In addition, Norton Auntie Virus 2004 got blown out of the System tray. I
did not notice the point at which this occurred. Note that I do not use the
NAV Office plug-in and I disabled NAV's Autoprotect when I ran the macro, so
NAV should not have been poking around.
Perhaps, most important, I noticed the following.
While scrolling thru the list of Headings in the cross reference menu, the
first 32767 were listed in a normal font, but starting with 32768, both the
paragraph number and text are dimmed
My questions include:
1. What is the limit on the number of Heading numbered paragraphs that may
be included in a document?
2. What is the limit on the number of such paragraphs that may be
consistently cross referenced via the cross reference menu?
I do recall seeing a statement that the number of bookmarks in a document
is limited to about 16K. Obviously, that places an upper limit on the number
of heading paragraphs that can be cross referenced, and the number is
reduced further by other bookmarks that may be used in the document.
So, I also must wonder why Word allows the inclusion of more heading
paragraphs than the bookmark limit without some sort of warning? Heck, I
imagine if I tried to generate a TOC, things really would have gone haywire.
And, of course, my last silly question, where's the documentation?
--
http://www.standards.com/; See Howard Kaikow's web site. Tag: Dual page numbering and TOC Tag: 61300
Storing Program Settings
Hello,
I have around 30 (at most) text boxes and combo boxes that have settings
which need to be stored and restored when the program starts. (This is a VBA
program but I think, it also applies to VB). In the future, many more
settings could be added and they would also have to be saved and loaded
(like a template a program uses for different conditions). I am not sure
about the best way to go about this that could save coding in the long run.
I wanted to write a text file like:
Condition1;Value1;Value2;Value3
Condition2;Value1;Value2;Value3
Condition3;Value1;Value2;Value3
and when loading this file, to load (say) the first three textboxes with
their corresponding values, I would split each line and check the condition
and populate the textboxes / comboboxes. Is this the best way to do this?
Thank you for your time / responses.
Vince Tag: Dual page numbering and TOC Tag: 61296
How to get the "next table" and the "previous table"
There are some tables in my document, and the cusor focus in somewhere.
How can I get the object of next table, like this statement:
Set oTab = Selection.Tables(1).Next 'this is pseudocode Tag: Dual page numbering and TOC Tag: 61294
Running a Macro in a Template, on Event
Hi.
I have a macro that I've constructed in word which will insert bookmarks as
per a table template that I've created in our Visual FoxPro based
database/frontend. The Visual FoxPro frontend inserts this information into
Word - and I've also instructed it to use a word template which contains my
Macro
The Macro works fine, but what I'm wanting to do is automate the process,
rather than having to run the Macro once the document has been produced from
FoxPro, using the .dot file.
Is there any way to make this happen? I've tried several of the On-Events
but none of them seem to work. What I basically want it to do, is once the
Document has been opened and the information has been sent to it from our
FoxPro database, that the Macro automatically runs
Thanks in Advance
David Bloch
Houston Medical Tag: Dual page numbering and TOC Tag: 61290
Word Template - wanting to run a Macro on opening
Hi
I have a Word template that I've created which has a macro attached to
insert bookmarks across a letter template we have in our database
system. The database system uses the object libraries in Word to
create the Word Document and can use a template to start its design
with.
This works fine and the Macro will work across the letter template we
extract from our database. What I am wanting to do is make the code
run automatically as soon as the template has been opened.
Here is the code I have so far.
Sub Bookmarks()
'Enter the number of lines in the letterhead. I.E six lines is 11
LineCount = 11
' Pat Name Bookmark
Selection.GoTo What:=wdGoToLine, Which:=wdGoToFirst,
Count:=LineCount
With Selection.Find
.Text = "Patient Name:"
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCell
ActiveDocument.Bookmarks.Add Range:=Selection.Range,
Name:="patname"
' Your Ref Bookmark
Selection.GoTo What:=wdGoToLine, Which:=wdGoToFirst,
Count:=LineCount
With Selection.Find
.Text = "Your Ref:"
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCell
ActiveDocument.Bookmarks.Add Range:=Selection.Range,
Name:="yourref"
' Address Bookmark
Selection.GoTo What:=wdGoToLine, Which:=wdGoToFirst,
Count:=LineCount
With Selection.Find
.Text = "Address:"
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCell
ActiveDocument.Bookmarks.Add Range:=Selection.Range,
Name:="address"
' Our Ref Bookmark
Selection.GoTo What:=wdGoToLine, Which:=wdGoToFirst,
Count:=LineCount
With Selection.Find
.Text = "Our Ref:"
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCell
ActiveDocument.Bookmarks.Add Range:=Selection.Range,
Name:="ourref"
'DOB Bookmark
Selection.GoTo What:=wdGoToLine, Which:=wdGoToFirst,
Count:=LineCount
With Selection.Find
.Text = "DOB:"
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCell
ActiveDocument.Bookmarks.Add Range:=Selection.Range, Name:="dob"
' Reqdate Bookmark
Selection.GoTo What:=wdGoToLine, Which:=wdGoToFirst,
Count:=LineCount
With Selection.Find
.Text = "Request Date:"
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCell
ActiveDocument.Bookmarks.Add Range:=Selection.Range,
Name:="reqdate"
' Sex Bookmark
Selection.GoTo What:=wdGoToLine, Which:=wdGoToFirst,
Count:=LineCount
With Selection.Find
.Text = "Sex:"
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCell
ActiveDocument.Bookmarks.Add Range:=Selection.Range, Name:="sex"
' CollectDate Bookmark
Selection.GoTo What:=wdGoToLine, Which:=wdGoToFirst,
Count:=LineCount
With Selection.Find
.Text = "Collection Date:"
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCell
ActiveDocument.Bookmarks.Add Range:=Selection.Range,
Name:="collectdate"
' Medicare Bookmark
Selection.GoTo What:=wdGoToLine, Which:=wdGoToFirst,
Count:=LineCount
With Selection.Find
.Text = "Medicare No:"
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCell
ActiveDocument.Bookmarks.Add Range:=Selection.Range,
Name:="medicare"
' RecDoc Bookmark
Selection.GoTo What:=wdGoToLine, Which:=wdGoToFirst,
Count:=LineCount
With Selection.Find
.Text = "Receiving Doctor:"
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCell
ActiveDocument.Bookmarks.Add Range:=Selection.Range,
Name:="recdoc"
' RecDocRef Bookmark
Selection.MoveRight Unit:=wdCell
ActiveDocument.Bookmarks.Add Range:=Selection.Range,
Name:="RecDocRef"
' CopyToDoc Bookmark
Selection.GoTo What:=wdGoToLine, Which:=wdGoToFirst,
Count:=LineCount
With Selection.Find
.Text = "Copy To Doctor:"
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCell
ActiveDocument.Bookmarks.Add Range:=Selection.Range,
Name:="copytodoc"
' CopyToDocRef Bookmark
Selection.MoveRight Unit:=wdCell
ActiveDocument.Bookmarks.Add Range:=Selection.Range,
Name:="copytodocref"
' Examination Bookmark
Selection.GoTo What:=wdGoToLine, Which:=wdGoToFirst,
Count:=LineCount
With Selection.Find
.Text = "Examination:"
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCell
ActiveDocument.Bookmarks.Add Range:=Selection.Range,
Name:="examination"
' Findings Bookmark
Selection.GoTo What:=wdGoToLine, Which:=wdGoToFirst,
Count:=LineCount
With Selection.Find
.Text = "$$"
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCell
ActiveDocument.Bookmarks.Add Range:=Selection.Range,
Name:="Findings"
' Go Back to Top of Document
Selection.GoTo What:=wdGoToLine, Which:=wdGoToFirst
End Sub
With another part of code.
Public WithEvents appWord As Word.Application
Private Sub appWord_NewDocument(ByVal Doc As Document)
Call Bookmarks
End Sub
In the Documents
How can I make this automate once the merge from our database to the
word template is complete? Tag: Dual page numbering and TOC Tag: 61288
Not Visible Files
I have a routine that performs functions A,B & C when a document is open
(determined by "If Documents.count>0") and functions D,E & F when no documents
are open (and the screen is 'grey').
Ocassionally a file that I opened in VBA with the "visible:=False" method
set apparently is still technically open although it appears not to be (i.e.,
the screen is grey) (and it is not supposed to be. The routine that was
supposed to close it did not.)
How can I test for the existence of an open, not visible document.and then
close it? Documents.count always returns 1 in this situation but if I try to
close the ActiveDocument I get a runtime error saying that the function cannot
be performed because no document is open.
Thanks,
Ed Tag: Dual page numbering and TOC Tag: 61285
How do I get rid of the PDFMaker error message in WORD 2003?
I have followed the suggested remedy downloading any update from Adobe. I
still get the error message each time I open WORD. I tride the workaround
suggested in the message but the filename was not found. How do I get rid of
this message for good? Tag: Dual page numbering and TOC Tag: 61282
VBScript: Printing question...
I have some VBScript (in an Outlook Form), that calls
"CreateObject("Word.Application"). The script processes some data then at
the end of the procedure prints out the result. This works fine on my local
machine, however, if another user attempts the same process it does not print
the output.
Ref: [msgbox "Printing to " & objWord.ActivePrinter] below...
I added the msgbox, and now verified that on each machine the correct
printer is configured (or displayed) in the msgbox. But, the form does not
print. What I observe is; the item shows up in the respective printer
queue(s) (but only for a very brief second) then vanishes and nothing
prints... Suggestions/comments?
Current working code (except printing on other machines...)
'----------------------Printing Routine------------------------
Dim objWord
Dim strTemplate
Dim strField
Dim strField1
Dim objDoc
Dim objMark
Dim mybklist
Dim counter
Sub cmdPrint_Click()
Item.Save
Set objWord = CreateObject("Word.Application")
' Put the name of the Word template that contains the bookmarks
strTemplate = "OSR.dot"
' Location of Word template; could be on a shared LAN
strTemplate = "\\ivory\forms\" & strTemplate
Set objDoc = objWord.Documents.Add(strTemplate)
Set mybklist = objDoc.Bookmarks
For counter = 1 to mybklist.count
Set objMark = objDoc.Bookmarks(counter)
strField = objMark.Name
If strField = "SentField" then
strField1 = CStr(Item.SentOn)
Else
strField1 = Item.UserProperties(strField)
End If
objMark.Range.InsertBefore strField1
Next
msgbox "Printing to " & objWord.ActivePrinter
objDoc.PrintOut
objWord.Quit(0)
End Sub
Thanks VERY much, in advance!
Bill Billmire -
--
Bill Billmire Tag: Dual page numbering and TOC Tag: 61279
Tab Position
Hi,
I am new to VBA in Word. Would anyone be able to answer
this:
If I have two tabs and I am at the position starting at
the second tab, how can I determine in VBA if there is
anything at the first tab on the next line. For example:
Tab 1 Tab 2
Line 1 Some Text Some other text
Line 2 Yet more text
If there is a paragraph mark at the end of "Some other
text" on Line 1, when I return to the start of the next
line, how can I determine if there is anything at Tab 1
for the second line?
I hope I am explaining this clear enough! Any help would
be appreciated.
Thanks. Tag: Dual page numbering and TOC Tag: 61278
identifying most recently used symbol (via VBA) in MSO2003, as shown in the insert symbol dialogue box
Does anyone know where the information for the most recently used symbol can
be accessed via VBA? It must be stored somewhere, because it is the leftmost
symbol of the recently used symbols in the insert symbol dialogue box.
I often use the same symbol lots of times in a single document, so I want to
assign a macro to a custom button that simply inserts whatever the last
symbol was that was inserted in the document. It'll still be better than
using the keyboard shortcut, for example [<alt>+0176], assuming I could even
remember the keyboard shortcut... :-/
Thanks!
Keith
--
The enclosed questions or comments are entirely mine and don't represent the
thoughts, views, or policy of my employer. Any errors or omissions are my
own. Tag: Dual page numbering and TOC Tag: 61276
Word Field Merge with Excel
Hello,
What procedure would I need to follow to have a field in MS Word import/fill
with values from MS Excel on a cell-by-cell basis (i.e. value from A1, A2,
A3, A4 etc.)
Your help would be greatly appreciated.
Ed Tag: Dual page numbering and TOC Tag: 61271
Macros Disabled in Word 2003
Hi,
I am trying to run a macro but I continue to get an error message indicating
that macros are disabled, I have followed the steps outlined in the online
help but this does not appear to make any diff. I can open up the macro and
get it to run on my desktop but not on the laptop.
Any help would be appreciated. Tag: Dual page numbering and TOC Tag: 61270
Macros
I am trying to make two simple macros which do not seem to work. If you can
help I would really appreciate it.
(1) I am trying to make a macro to go into Edit, Paste Special,
Unformatted Text. Every time I try to do it, the macro runs with the text
formatted.
(2) Word's toolbar print button when pressed, automatically prints the
page without giving you the Print dialog box first. So I am trying to make a
macro to print with the dialog box opening so I can then put it on the
toolbar. But I cannot end the macro with the dialog box open - it won't
allow it. Tag: Dual page numbering and TOC Tag: 61264
How to serach breaks of sections, columns or text wrappings?
Is there a way to find these breaks in a document in Word XP? Do these
breaks have vb constants for which one could search with VBA?
TIA,
ANDy
-- Tag: Dual page numbering and TOC Tag: 61263
Checkbox form
When I add a checkbox to my template, the document creates an X in the box
instead of a checkmark. Does anyone know how to change that? I can't find
the answer anywhere. Why would a check box button create an x?
thanks Tag: Dual page numbering and TOC Tag: 61258
Find the value of an charecter adjacent to the selection?
I would like to step through a document until a full stop is found and
then insert a character IF the next character is a space.
So I look for a "." with Selection.Find, but how could I proceed then?
Does Word XP VBA have a built-in function to evaluate the character next
to the position where the Find statement brings me (the selection
containing the full stop)?
Best,
ANDy
-- Tag: Dual page numbering and TOC Tag: 61252
embedding visio objects in word 2000 error
At the present I am having problems trying to open picture logo objects in a
word 2000 document. Instead of the logo picture I get {embed word.picture.8}.
I have reinstalled the office 2000/word/service packs etc.
I will be grateful for any help,
Mark Palmer. Tag: Dual page numbering and TOC Tag: 61250
Merge with conditions. Pls help
------------------------
Name Stuff Num
------------------------
David Ball 2
Ali Cake 1
Sue Ribbon 3
Kelly Chair 2
Mail Merge
if Num = 2, merge as shown below:
David <-show in merge doc
Kelly <-show in merge doc
if Num = 1, merge as shown below:
Ali
if Num = 3, merge as shown below:
Sue
Can this type of merging be done in Microsoft Word??? Tag: Dual page numbering and TOC Tag: 61243
Word 2000 Looping Macro How To
Hi,
I've got a partial macro that correctly performs the beginning of what I
want but then fails. Here is what I've got:
Sub BlogEq_URL_Formatter()
'
' BlogEq_URL_Formatter Macro
' Macro recorded 1/6/2005 by .
'
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Copy
Selection.EndKey Unit:=wdLine
Selection.TypeParagraph
Selection.Paste
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "\[?*/"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
With Selection
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseStart
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseEnd
Else
.Collapse Direction:=wdCollapseStart
End If
.Find.Execute
End With
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "\.?*\]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
With Selection
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseStart
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseEnd
Else
.Collapse Direction:=wdCollapseStart
End If
.Find.Execute
End With
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "-"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.HomeKey Unit:=wdLine
End Sub
It's supposed to take a list of URLs, one per line, and extract some
information from it and then put that on the next line. It does that fine,
but I need it to repeat until the end of the document.
Right now, it does the first line and then a message pops up asking me if I
want to continue searching the rest of the documnet. If I click no, the macro
stops. If I click yes, the macro finds "-" and replaces with a space.
I need the macro to somehow automatically quit finding "-" and return to the
beginning of the macro and continue on until there are no more URLs in the
document.
The URLs look like this:
[http://mydomain.com/this-page.html]
[http://mydomain.com/this-other-page.html]
And I'm trying to get:
[http://mydomain.com/this-page.html]
this page
[http://mydomain.com/this-other-page.html]
this other page
Any help is greatly appreciated.
Thanks,
Robert Tag: Dual page numbering and TOC Tag: 61242
How to write a macro to extract content from word to excel .copy .
I am trying to write a macro in excel which will extract the tabular data in
word .. so that I can consolidate the info from multiple word files into
excel report.... but here I am able to open word document and select the word
content from table 1 and put the data into excel .. but my next lines of code
which try to copy other parts of the word document seems to be not working
anymore .... Tag: Dual page numbering and TOC Tag: 61239
how to find a number with that macro
Hi, I am finding character all right with it but does not work with number,
please help me to understand why?
--
XP home , Office 97
any or all responses are gratefully accepted and thank you for your time
Running Compaq P3, 500Mhz
WIN XP home, Office 97
Dialup (no choice here) Tag: Dual page numbering and TOC Tag: 61238
how to find a number with that macro
--
XP home , Office 97
any or all responses are gratefully accepted and thank you for your time
Running Compaq P3, 500Mhz
WIN XP home, Office 97
Dialup (no choice here) Tag: Dual page numbering and TOC Tag: 61237
Regex & Wildcards
Hey,
I need to find the following by matching Wild Cards.
1.1 mol/L
1 mol/L
1mol/L
1.1 mol /L
1 mol /L
1mol /L
1.1 mol / L
1 mol / L
1mol / L
1.1 mol/ L
1 mol/ L
1mol/ L
A sentence could contain any one this. For instance "James drank a solution
of Nitrogen Peroxide with a concentration of 5.15 mol/L".
This is what I could come up with:
([0-9.]@)( @)(mol/L)
Takes care of any numerals / decimals but does not account for:
a) The space between the number and mol/L (It looks for one space or more
but there is a possibility that a space might not exist like 1.1mol/L)
b) It strictly looks for mol/L and can't account for mol / L, mol/ L or mol
/L. In order to use this, I would have to repeat each instance with
appropriate spaces!
Questions:
1) How do I write a single Wildcard match for all the possibilities listed
above?
2) How can I say "Optional" in Regex. Eg. Di[peg] could be anyone of "Dig"
"Dip" or "Die". But I need to say that "Di" may or may not be followed by
"p" "e" or "g". In Perl, I would say "(Di)([epg])*" How do I say that in
VBA?
Thanks a lot for your time / any reponse.
Vince Tag: Dual page numbering and TOC Tag: 61236
>> Mail message
Hi, I have created a word template that is used as an
email template. When used to create a new document the
email address detail section is visible. When creating a
new document using code the email section is not visible.
I have tried the line...
Set docReminder = Documents.Add( _
Template:=TEMPLATE_PATH & "Contracter Report
Reminder.dot", _
DocumentType:=wdNewEmailMessage, _
Visible:=False)
But the document type wdNewEmailMessage causes a blank
email page. That is the contents of the template are
removed.
How do I show the email address section when creating a
document using code?
Any ideas or suggestions appreciated :-)
Thanks
Jonathan Tag: Dual page numbering and TOC Tag: 61234
Question about hover tips
I can't find what to call these so I'm referring to them as hover tips. I'm
referring to the messages that appear when I run my cursor over the toolbar
icons. For example, when I just placed my cursor over the "New Post" icon
in Outlook Express, "Write Message" appeared.
My question is whether VBA supports such a functionality on userforms. I'd
like a brief explanatory message to pop up when a user runs their cursor
over a check box option.
Barney Byrd Tag: Dual page numbering and TOC Tag: 61232
Question about hover tips
I can't find what to call these so I'm referring to them as hover tips. I'm
referring to the messages that appear when I run my cursor over the toolbar
icons. For example, when I just placed my cursor over the "New Post" icon
in Outlook Express, "Write Message" appeared.
My question is whether VBA supports such a functionality on userforms. I'd
like a brief explanatory message to pop up when a user runs their cursor
over a check box option.
Barney Byrd Tag: Dual page numbering and TOC Tag: 61231
Question about hover tips
I can't find what to call these so I'm referring to them as hover tips. I'm
referring to the messages that appear when I run my cursor over the toolbar
icons. For example, when I just placed my cursor over the "New Post" icon
in Outlook Express, "Write Message" appeared.
My question is whether VBA supports such a functionality on userforms. I'd
like a brief explanatory message to pop up when a user runs their cursor
over a check box option.
Barney Byrd Tag: Dual page numbering and TOC Tag: 61230
Print Layout window VBA Code
I am writing a VBA macro for a word template and when I open the document it
comes up in the normal view instead of the print layout view. After the
document is open I can go View - Print Layout but others will be using the
template so I would like it to open automatically in the Print Layout view. I
am using Word 2003. How can I make the document open in Print Layout using
VBA code.
Thanks Mike Tag: Dual page numbering and TOC Tag: 61229
How do I put a border around just 1 column?
I am using Word 2003 to make a booklet using a 2 column document. I wanted to
use word art and a border around just one column but I can only get it around
the entire page. Can you help? Tag: Dual page numbering and TOC Tag: 61228
Word (.doc) -> Text (.txt) conversion
I'm running a large site which received many .doc files daily which
need to be converted into plain text, the purpose of which is to supply
data for the site's search engine which then points users to the
appropriate .doc files. The raw text is also needed to populate HTML
preview pages for the .doc files.
My question is simple - what is the easiest (preferably server side)
method for converting .doc files into raw text. I'm running Windows
server so I presume that .doc API and script commands would be fairly
easy to implement. If a server side solution is impossible then a
locally executed method could fit the bill too. It just needs to be
QUICK and AUTOMATED. I'm not going to copy and paste from MS Word into
Notepad for 10 hours every day.
Any suggestions kindly requested.
Rob Ponting
rob_ponting@hotmail.com Tag: Dual page numbering and TOC Tag: 61227
AutoCorrect.dot : Run-time error '5941' ?
greetings!
and apologies if this is the wrong forum (please redirect me if it is).
i need to export and import all my AutoCorrect entries, so they can be
transferred to another machine. when i run dave rado's autocorrect.dot
(http://word.mvps.org/FAQs/Customization/ExportAutocorrect.htm) on work2k
(under winxp) i get an error box saying
"Run-time error '5941':
The requested member of the collection does not exist."
when i click "end" (1 of 3 choices, the other being "debug" and "cancel"), i
get a newly created word document with a table, several rows filled with my
entries, and then several more table rows empty.
saving this document, and running autocorrect.dot (restore) on it gets me
another box saying "This document is not in the correct format for an
AutoCorrect Backup document".
i tried deleting the blank table rows, saving, and using this instead, but
get the same "This document is not ..." error box.
i tried running Macros9.dot, but only a very few rows are created, meaning,
most of my autocorrect entries are ignored.
any and all help would be appreciated!
cheers,
pns Tag: Dual page numbering and TOC Tag: 61221
How do I display different parts of a Word document based on form.
I am creating a Word Template which needs to display different sections of
the document based on the selection in a form field at the beginning of the
document. I need to minimize macro's - although I know this will require
one. I don't want to put the entire text of the required section in the macro
if there is a way to create the document and simply 'hide' the unnecessary
sections based on form field selection. Any ideas? Tag: Dual page numbering and TOC Tag: 61219
toc
Is it possible to retrieve TOC info? I want to know how many first
level TOC item and how many second level TOC item my document has. and
is it possible to select base on the TOC item?
thanks
Tomcat Tag: Dual page numbering and TOC Tag: 61216
Read Tabstops Manually applied to a paragraph
I want to read only the tabstops that have been manually applied
to a paragraph (Not tab stops in the style or the default tab stops).
Both of the following reads default tab settings.
Greatly appreciate all Help.
Sub ReadTabs1()
Dim sTmp As String, i As Integer, Para As Paragraph
Set Para = Selection.Paragraphs(1)
For i = 1 To Para.TabStops.Count
sTmp = sTmp & CStr(Para.TabStops(i).Position / 72) & _
": " & CStr(Para.TabStops(i).Position) & vbCrLf
Next
MsgBox sTmp
End Sub
Sub ReadTabs2()
Dim sTmp As String, tb As TabStop, Para As Paragraph
Set Para = Selection.Paragraphs(1)
For Each tb In Para.TabStops
sTmp = sTmp & CStr(tb.Position / 72) & _
": " & CStr(tb.Position) & vbCrLf
Next
MsgBox sTmp
End Sub
--
Tim Shaffer Tag: Dual page numbering and TOC Tag: 61215
Selection.Information
Hi,
I am using the following to get the number of pages there
are in a Word document (from within Excel). I can also use
it directly in Word without the "appWrd ".
Dim EndPage as Integer
EndPage = appWrd.Selection.Information
(wdNumberOfPagesInDocument)
This works sometimes, but the other times I get the error
message "Run Time Error 91 Object Variable or With Block
Variable not Set".
Is there something additional I need to do so I do not get
this error? I do not understand why it works sometimes but
not all the times.
THANKS! Tag: Dual page numbering and TOC Tag: 61212
repeat Find & Replace until no more ocurrences are found
Hi,
I want to replace all instances of multiple consecutive spaces in a
document.
When I record a Find & Replace command, 2 spaces are replaced with 1.
And 3 spaces become 2; 4 become 3, etcetera, so multiple spaces still exist.
This is the recorded code from Word XP.
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " "
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
How can I efficiently change the code so it goes on replacing multiple
spaces until only single spaces are left?
Best regards,
ANDy Tag: Dual page numbering and TOC Tag: 61206
Per article 291283 "seq method", how do I set correct page numbering for the
TOC?