Convert number to currency format
Can VBA take a numeric variable and convert it into a currency format (a
dollar sign at the beginning, and commas where appropriate) so that I
can type it out with Selection.TypeText()? Thanks. Tag: need the download the program needed to use Speech recognition Tag: 100591
Macros on toolbar
When I place a new macros on the toolbar, it overwrites the one that is
already there. What am I dooing wrong? Tag: need the download the program needed to use Speech recognition Tag: 100590
Use VBA to Insert a hyperlink into a table cell
I am looking for a way to insert a hyperlink into a table cell in Word. I am
using an excel spreadsheet to create a word doc with a table in it and I
would like to create links as I am filling in the table. Thanks. Tag: need the download the program needed to use Speech recognition Tag: 100589
Height or linecount of a cell?
This is a legal document application. In a row 1 of a table, cell 1 has a
variable amount of text, the number of lines may be determined by any
combination of paragraphs, linefeeds, or text wrapping.
In cell two, I want to use VBA to insert a series of right-parens and paras,
i.e. ")" & vbNewLine, until the height of cell two (or number of lines in
cell two) is equal to the original height (or number of lines) in cell one.
I've caught tantalizing snippets in various posts, but still have no way to
determine the acutual height of a row or cell, or the number of lines in a
cell or selection.
Can anyone help?
Bear
--
Windows XP, Word 2000 Tag: need the download the program needed to use Speech recognition Tag: 100585
Validation of form field
We're still using Word 97!
Can someone assist me with some code which looks at the result of a form
field and if the form field contains a "/" or "\" the user is presented with
a msgbox stating that these characters cannot be used?
Mark Tag: need the download the program needed to use Speech recognition Tag: 100583
Convert Table of Contents(TOC) into Text
I have a table of contents that I asked questions about making page links to
each line in the TOC. I got some great suggestions, but the control click
issue is a problem for the client. Is there a way to convert a TOC to
straight text so I can do hyperlinks to specific bookmarks with a straight
rollover?
Thanks,
John schenkel Tag: need the download the program needed to use Speech recognition Tag: 100580
"Continuous section break" is changed to "Next page section break"
Hi:
I have a document like below:
Section1----------Section Break(Continuous)-----
Section2 ----------Section Break(Continuous)-----
when I select all text and new a document,then paste it. The last section
break type is changed to "Section Break(Next page)" auto,like:
Section1----------Section Break(Continuous)-----
Section2 ----------Section Break(Next Page)-----
could you help me to look it? Thanks. Tag: need the download the program needed to use Speech recognition Tag: 100573
Macros and drop-down lists
Can I create different macros that will run when a selection is made from a
drop down list in a form? Is there an easier way? This works but the drop
down list disappears as soon as a selection is made and it is not always the
correct macro that runs. Tag: need the download the program needed to use Speech recognition Tag: 100571
Save document as .doc not .dot
How can I force a document to always save as a .doc? Currently, when people
use my automated document and they do "save as" the dialog box defaults to
.dot. If they inadvertenly save as a .dot, all the vba code behind the doc
gets dropped!
--
Thanks in advance for any direction you can provide!
Mona-ABE Tag: need the download the program needed to use Speech recognition Tag: 100562
help?
Can anybody suggest which book is the best to practice and learn VBA(i want
something with many examples). I am currently programming in MS Word VBA. I
live in canada so, i something i can find easily here.
thanks Tag: need the download the program needed to use Speech recognition Tag: 100559
Delete everything within a range
I am trying to delete everything within a range. Currently I am
mostly concerned about text and tables, but will eventually need to
include drawing objects and other such items. I can delete the text
by setting the Range.Text property to the empty string, but how can I
remove the tables. If I use the Range.Tables property, I get the
tables inside the range in most situations, but if the range is inside
of a table I get the outer table, resulting in me deleting much more
than I want to. Can someone please help me with a method to delete
everything from within a range, or at least delete all tables within a
range, without deleting parent tables of a range. Tag: need the download the program needed to use Speech recognition Tag: 100555
How toopen Access Pivot Table directly in excel from switchboard?
I made a Pivot table in Access. The pivot table takes three steps to open
... open the form, press the 'edit' button, then open in excel/manage the
onscreen view. Is there a way to program access to open the access pivot
table directly in excel? Want to keep it v-e-r-y simple & quick for users.
Thanks!!! Tag: need the download the program needed to use Speech recognition Tag: 100553
Electronic forms
Hello Everyone:
I am creating some forms in Word 2002. The forms are locked so many of the
text formatting features that staff members would like to use when filling
out the form are disabled. The staff members would like to edit the text
they input by insreting bullets and changing font styles to bold or italic.
Can anyone suggest a way for me to work around this problem?
Thanks,
Nadine Tag: need the download the program needed to use Speech recognition Tag: 100551
A recorded macros to assign style "Normal" doesn't work
I have created new style "Case Cite" as applying Italics.
I recorded two new macros to apply "Case Cite" and "Emphasis" to selected
text; both macros select styles from the tool-bar, type in the style name,
and end with "Enter." I created new macro buttons for each. They all work
as expected.
I then wanted to be able to return text that I'd styled as "Case Cite" or
"Emphasis" to "Normal" text. I recorded a similar macro to reapply "Normal"
to the styled text. But this recorded macro results in the text being styled
"Case Cite + Normal" or Emphasis + Normal" rather than merely "Normal." When
I enter the same routine manually, it generates the expected "Normal" style.
I would sincerely appreciate any suggestions or explanations.
Very respectfully,
Larry Tag: need the download the program needed to use Speech recognition Tag: 100543
Creating Link in table of contents to specific pages???
I have a word document that is over 1000 pages and it has a table of
contents. My client wants to be able to click on a specific line in the
table of contents and it will take the user to that specific page. Is this
possible? If so, I would be greatful for some help!
Thanks in advance!
John SChenkel Tag: need the download the program needed to use Speech recognition Tag: 100541
Delete tables within a bookmark
I am trying to delete everything within a bookmark. I can delete the
text by setting the text property of the bookmark's range to an empty
string. This, however, doesn't remove the tables. If I use the
Tables property of the range and iterate through to delete them, it
works to delete all the tables inside, but only if the range is not
entirely inside of a table. If a range is inside of a table, the
Tables property returns that parent table and it gets deleted instead.
Does anyone know how to get the tables that are inside of a range,
without getting the table that the range is inside of. Even better
would be a mechanism to delete everything within a Range, including
text, tables, drawing objects, etc., but I have pretty much given up
on that approach and labeled it impossible without iterating through
each of these individually.. Tag: need the download the program needed to use Speech recognition Tag: 100539
Detaching references in a word docu
I have an urgent need to detach the references in a Word document for a grant
deadline.
I am required by the new NIH PureEdge software for electronic grant
submission to section off the 15 page narrative and 5 page end reference
section. When I divide the document into sections, the endnote references are
detached and go with each section. I need to put all the references in one
section, with numbers that are not electronically attached to the end
reference document but still numeric indicators of the indicated references.
Cutting and pasting the references separately has not worked. Please help!
Rhonda Randolph
Medical University of SC Tag: need the download the program needed to use Speech recognition Tag: 100534
Where can I get a basic, but clear, understanding of Macros.
I do not want to read heavy tomes on Macros is there anywere that I can get a
basic understanding of how to create Macros, besides using the auto function
in Word. Tag: need the download the program needed to use Speech recognition Tag: 100523
call .NET DLL
Hi,
is it possible to call .NET DLL from VBA?
How?
Best regards
Seb Tag: need the download the program needed to use Speech recognition Tag: 100522
UserForm_Initialize()
Need to find more info about the order in which the sub routines for
UserForm events UserForm_Activate(), UserForm_Initialize(), are executed,
which one is executed first and also other events that belongs to the
UserForm object Tag: need the download the program needed to use Speech recognition Tag: 100521
prevent to show part of document
Could I prevent from showing part of open document?
I try to solve one problem and one of possible sollution could be show just
two pages of three.
Gives Word or VBA som possibilities?
Peter KNAP Tag: need the download the program needed to use Speech recognition Tag: 100517
=?ISO-8859-1?Q?=22=E9chec_de_la_fermeture_du_presse-pa?=
Bonjour,
Que faire pour emp=EAcher ce d=E9faut:
"=E9chec de la fermeture du presse-papiers"
qui appara=EEt quand je cherche =E0 restaurer le contenu sauvegard=E9 du =
presse papier par PutInClipboard ?
D'avance merci.
hpa Tag: need the download the program needed to use Speech recognition Tag: 100516
MVP Status
Fellow regular posters and MVP's,
I've been declined the MVP status of this year.
A decission of MS, I can't comprehend and validate:
If there are persons willing to doubt this decission, kindly feedback on
this thread.
--
Krgrds,
Perry
System:
Vista/Office Ultimate
VS2005/VSTO2005 SE Tag: need the download the program needed to use Speech recognition Tag: 100515
loading userforms
Should you always load a userform before showing it?
What is the advantage of loading the userform and then showing as opposed to
just showing?
Thanks. Tag: need the download the program needed to use Speech recognition Tag: 100510
Is there a Clippy replacement for 2007
I wrote quite a few help systems for my office using what many people have
described as 'that annoying Clippy.' As it turns out, he was endearing for
the purpose used, and, properly configured in VBA, it allowed tremendous
'go forward' and 'go backward' controls, numbering, bulleting and autosizing
features just not found in the standard message box.
Is there anything thing that replaces this feature in 2007? Any 3rd party
programs?
Ed (in Virginia) Tag: need the download the program needed to use Speech recognition Tag: 100504
Connect mysql with vba
Hi,
I'm writing a word vba which require to connect the mysql database.
I'm new to database thing, any1 have any idea ??
I'm thinking to the ADODB.Connection
But, I have no idea about the connectingstring, provider and driver,etc
I'm using "Mysql server 5.0" I've install in my computer, so I can do the
testing on my comp (localhost), and need to connect to the server on the
network later.
Many thanks Tag: need the download the program needed to use Speech recognition Tag: 100502
Last page _ BLANK
I have problem with this macro:
Dim i As Long
i = 5
Dim source As Document, target As Document
Set source = ActiveDocument
Set target = Documents.Add
target.Range.FormattedText = source.Sections(i).Range.FormattedText
After user click last button of user form just appropriate section of active
document is shown. This is perfect however problem is that it always inserts
one empty page at the end of section. I thought it is problem with formatting
of text but it is plenty of place at the end of page for text (so I think
problem is not with page or section brake).
Could somebody help?
peter Tag: need the download the program needed to use Speech recognition Tag: 100499
How to hide source document?
Hi.
I am trying to create form for submission of applications where all used
forms are in one document in separate sections. After user open template of
this document macro asks him through UserForms what kind of application is he
asking for. Then he is asked to fill in the appropriate boxes in UserForms
and at the end only filed section is shown. Problem for me is that with
filled form also template document stays open.
I tried to write macro for closing source template document:
ActiveDcument.Close
but since template is actually active document last part of my macro:
Dim i As Long
i = 5
Dim source As Document, target As Document
Set source = ActiveDocument
Set target = Documents.Add
target.Range.FormattedText = source.Sections(i).Range.FormattedText
did not work because active document was no longer open then.
How could I solve this problem? I want user to see just UserForms and at the
end just part of the document he will print. Tag: need the download the program needed to use Speech recognition Tag: 100498
Creating a variable
This is what I need to do:
If TextBox1 on UserForm1 is blank when the UserForm is unloaded, I want to
create a public variable called "incomplete" (would also want that
variable deleted if it already existed and TextBox1 were not blank when the
UserForm where unloaded). Then when I open UserForm4 if the variable
"incomplete" exists, I want the BackColor of CommandButton1 to be red. Tag: need the download the program needed to use Speech recognition Tag: 100489
OptionButton Group question
On my UserForm I have a number of OptionButton groups and each group has a
Label associated to it. This is a series of questions with 3 possible
answers for each question.
What I would like is some code which would change the color of the text in
the label from black to red, if none of the 3 OptionButtons in the group is
true. I am hoping this could be done by Option Group as opposed to writing a
click event for each OptionButton. Tag: need the download the program needed to use Speech recognition Tag: 100482
checking if folder exists and if not create it
Hi, I've got some code that move files, but I need the code to check if the
destination folder exists and if it doesn;t to create it.
I think I can do the code to create if, but not sure how to check if it
exists?
My code is below. I need help with the ***** bit. Thanks for any help.
Dim oldfilepath as String
Dim newfilepath as String
Dim myFile as String
Dim fso
oldfilePath = "C:\old\"
newfilePath = "C:\new\"
myFile = "randomfile.doc"
Set fso = CreateObject("Scripting.FileSystemObject")
***** if newfilepath exists then
'do nothing
else
fso.CreateFolder(newfilepath)
end if
oldfilepath = oldfilepath & myFile
newfilepath = oldfilepath & myFile
Name oldfilepath As newfilepath Tag: need the download the program needed to use Speech recognition Tag: 100477
Finding and converting text to hyperlink with VBA
Greetings from sunny Sweden,
I have a macro that converts a SGML-style (custom formatted) plain text file
to a word document with proper formatting (headers, styles etc.) but I cannot
figure out how to convert the links. How can I use the macro to locate
"tagged" (hyper-)links and convert them to working hyperlinks?
This is how it looks like:
---
Some text here. Some more text.
Click here to view the PDF: <LINK>FileName.PDF</LINK>
Even more text.
---
I want the "tags" to be removed and the text FileName.PDF to remain, but as
a functional (clickable) link to the PDF file. I know that there is a
search-and-replace method that can extract substrings from strings (have used
it for style control) but can't make it happen with the link creation.
Any coding hints would be appreciated.
Thanks in advance!
Jon Tag: need the download the program needed to use Speech recognition Tag: 100475
modified date
Hi, I;m using the following code to display the modified date of the active
document:
Dim dlvVersions As Office.DocumentLibraryVersions
Dim dlvVersion As Office.DocumentLibraryVersion
Dim strVersionInfo As String
Set dlvVersions = ActiveDocument.DocumentLibraryVersions
If dlvVersions.IsVersioningEnabled Then
strVersionInfo = dlvVersion.Modified
End If
MsgBox (strVersionInfo)
Set dlvVersion = Nothing
Set dlvVersions = Nothing
But it's debugging at:
Set dlvVersions = ActiveDocument.DocumentLibraryVersions
saying that 'No versions exist for this file'
Any ideas where I'm going wrong?
thanks. Tag: need the download the program needed to use Speech recognition Tag: 100471
adding gui application to word
Suppose i have a gui application (currently written in python) which enables
the user to create word tables, is there any way to insert this application
as some sort of a macro (meaning: adding a button to word clicking on which
will show the wizard)
Thanks Tag: need the download the program needed to use Speech recognition Tag: 100470
computer maintenince
how could where i could improve my knowlge on this
----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.
http://www.microsoft.com/office/community/en-us/default.mspx?mid=44eb36cd-57a8-464d-9739-ed4c9bcfc735&dg=microsoft.public.word.vba.general Tag: need the download the program needed to use Speech recognition Tag: 100469
loop through all docs in a folder
Hi, how do I loop through all documents in a folder and perform a task?
ie what I would like to do is:
- while there is a word document in folder
- open word document
- perform code
- next word document if there is one
Thanks. Tag: need the download the program needed to use Speech recognition Tag: 100447
Templates and Macros
Hi guys and gals,
I'm having trouble with a template in Word 2003. It has macros and forms in
it. When I create a document based on the template, the macros work while
on my machine. However, when I separate the document from the template, the
macros and forms no longer work. It appers they are not copied into the new
document.
Does anyone know how I can make the document carry over the macros and forms
from the template?
Thanks in advance
Stephen at ZennHAUS Tag: need the download the program needed to use Speech recognition Tag: 100440
Reading text at bookmark field
Hi All,
Bascially i have a bookmark "Claim_No", i want to be able read the data that
has been entered against it. I have had one of those days and i know it is
simple, but i just can't seem to remember how to do it.
Can someone please show me an example so that i can store it again in the
memorybank.
TIA
Justin Tag: need the download the program needed to use Speech recognition Tag: 100436
Set Word Options in VBA for Word 2007
I've created a macro to set Word Options to my needs in Word 2007. It
includes most of the properties settings for Options object and some
properties settings for Application & Window/View object. It runs VERY SLOW.
I stepped through each line of codes and found half of the settings take
several seconds to finish. The similar macro I created for Word
97/2000/2002/2003 run very smoothly, took just a second to finish all. I've
noticed the message "conneting to printer .." shown on the status bar when
the macro run and tried to turn off "Application.ScreenUpdating", no
difference. Does any one know how to fix this problem?
Thanks in advance. Tag: need the download the program needed to use Speech recognition Tag: 100408
Find the next blank line
Hello from Steved
I have a 6 paragraph then a blank line also i have paragraphs from 4 to 22
each with a blank line.
Please how do I find the next blank line, Yes I've tried using wildcard but
did not help me find the next blank line.
Thankyou. Tag: need the download the program needed to use Speech recognition Tag: 100402
deselect command in a macro
I have created a macro for users to update all the fill-in fields in my
document, but it puts me back in with the "WholeStory" still selected. AND
the recorder will not let me click on the document, right click and toggle
fields or any other way that I know how to deselect the material. This
document is going out to the entire company of about 2000 poeple and I know a
LOT of them are not computer savvy enough to do it themselves. SO, I want to
know what the command is that I can put within the macro to deselect the
WholeStory. I don't even know enough about Visual Basic to BE dangerous!!!
Thanks! Audrey Tag: need the download the program needed to use Speech recognition Tag: 100383
Form field frustration
I am having a couple of issues programmatically accessing form fields. I
have assigned â??bookmarkâ?? names to these fields and here is how I can use VBA
to see what has been entered in the field.
Dim FieldText as string
FieldText = Word.ActiveDocument.Bookmarks("LastName").Range.Text
The problems :
A) I cannot detect when the field is empty
B) Empty fields have text value of 5 spaces, but return FALSE when compared
to being equal to 5 spaces
C) Trim seemingly has no effect, as â??trim(FormField)â?? still = FormField = 5
spaces
D) Any attempt to erase the text in a form field by setting = â??â?? erases the
form field, setting equal to 5 spaces also does not work.
I need to be able to detect an empty form field, and be able to erase text
in form fields. Any ideas? Tag: need the download the program needed to use Speech recognition Tag: 100381
Insert superscripted ordinal date - Word 2000 ??
Hi all :)
I'm trying to create a macro that inserts the current date to replace
the selected text (not as a field).
------------------
Selection.InsertDateTime DateTimeFormat:="dd MMMM yyyy", InsertAsField:=
False, DateLanguage:=wdEnglishUK,
CalendarType:=wdCalendarWestern, InsertAsFullWidth:=False
------------------
is easy enough and gives me the date as 18 May 2007 but I need to insert
it as 18th May 2007 with the ordinal (st,nd,rd) in superscript.
I think that it's something to do with \* ordinal but I can't for the
life of me work out how the syntax goes. And I can't even begin to guess
how to do the superscripting!
Yes, I know it's a silly way of formatting a date - it wasn't my idea ;)
Thanks all :) Tag: need the download the program needed to use Speech recognition Tag: 100376
PrintDate from Protected document doesn't work
I have the following problem with PrintDate which appears only in Word 2000
In Word 2003 everything works OK. My users unfortunately use Word 2000
(9.0.4402 SR-1)
1) Users demand is that the footer contains PrintDate field
2) Second demand is that when approved, document is protected against
writing with password .
I protect document programmatically with following code
Const wdAllowOnlyComments=1
WordObj.ActiveDocument.Protect wdAllowOnlyComments, False, "PASSWORD"
3) PROBLEM IS FOLLOWING:
After protecting the document, PrintDate, after document has been printed
out, doesnâ??t work any more It is empty = 00.00.00000.
I also found out that the same problem with PrintDate appears also if I do
everything manually in Word so probably this is a Bug or something.
Can someone give me an advice what to do that PrintDate will work in Word
2000 (9.0.4402 SR-1). Maybe there is fix for this or some workaround?
Thank you
Lojze Tag: need the download the program needed to use Speech recognition Tag: 100373
How to remove italic formatting
I'm obviously a bloody beginner in Word.
I have some text, some of it formatted in the (italic) character style
"Emphasis", some of it with "italic" applied as manual formatting.
I want to have all the text formatted "not italic".
Selection.Font.Italic=False
does not work.
Am I overlooking an obvious, simple solution, or do I have to write some
elaborate code, just to remove the italic formatting?
Regards,
Klaus Tag: need the download the program needed to use Speech recognition Tag: 100359
Excel running Word macro
I have a complicated macro which does several things to a series of
imported htm files, however it is not working as expected.
An excel macro produces a list of htm files within a directory and
outputs it to sheet1 and then one by one uses this as a parameter to
start a word macro (ww has been defined as the word application
object)
ww.Documents.Open ThisWorkbook.Path & "\datastage1.doc"
runnow = ww.Run("stage1", file)
This runs the macro stage1 in the word document datastage1.doc using
the file stored in variable "file".
Sub stage1(myfile As String)
file = myfile
folderpath = ActiveDocument.Path & "\inputhtm\"
Documents.Open FileName:=folderpath & file
This word macro then opens the file and is meant to remove all
occurences of a two line text fragment using a word (XXPAEDT) to find
the first of those lines:
'DELETE UNWANTED LINES
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="XXPAEDT", Wrap:=wdFindContinue,
Forward:=True) = True
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Loop
End With
This does not work and the lines are not removed, yet if i open the
document manualy and then use the macro after removing the above
section that opens the htm file (so it starts with the remove unwanted
lines comment) it works perfectly!!!
Any ideas as to why the different behaviour if the file is opened
manually by the user or automatically by the macro
Thanks
Richard Tag: need the download the program needed to use Speech recognition Tag: 100349
Date + 1 Month
Hi there, I'm pretty new so bear with me.
I have a word document ask a user what a certain date is. Let's call it
"DATE A".
This date is inserted into the first row of a table.
I need to add 1 Month to this date in the next row. 2 Months to this date in
the row below, etc.
I.E. Let's assume DATE A is January 01, 2007. I need the next date in the
table to be Febuary 01, 2007, then March 01, 2007 etc.
Any clue on how I would do this? I've looked everywhere, and every thing
seems to be a little over my head.
Much appreciated. :)
Kevin Tag: need the download the program needed to use Speech recognition Tag: 100332
Code for Adding Custom Document Property
I have revised an existing template to contain a new custom doc property.
Since old documents (not containing the new property) will sometimes be
attaching to the template, I need to add code that checks the attached
document for the existence of the property & if it's not there, create it.
I know the code I need to use to add the custom document
property(ActiveDocument.CustomDocumentProperties.Add ...) , but I don't know
the best way to check for the property & tell it to execute the code if the
property is missing.
Also ... I read in another email thread that it may not be a good idea to
create the customdocument property with ActiveDocument since the property
exists in the template but not in the open doc. If the property existing in
the template but not in the active document creates a conflict, then what
should I use instead to create it?
Thanks for your help.
--
JoAnn Tag: need the download the program needed to use Speech recognition Tag: 100331
Detect if word document is open
How can I detect if a word document is open and if it is open how can i do
modification from MS access with VBA?
Thanks for any suggestion
Jose Tag: need the download the program needed to use Speech recognition Tag: 100329
Please help me get the program needed to run the Speech recognition program
on microsoft office program?