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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? 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: How to serach breaks of sections, columns or text wrappings? Tag: 61206
Change language of textboxes
I have a large document that is in English, it has within it drawings and
textboxes that were inserted by users whose language was set to French - How
can I change the language of all textboxes in a document? Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61199
Word Hang Bookmarks
I have a problem with the followed macro under Word. I have a document with
35 pages and I bookmarked each lines of this document which means that I have
nearly 600 bookmarks named started by SIMILIS_ and then a number beetween 1
and 600. The aim of this macro is to highlight each bookmarks. The problem
which appears is that after a while I have a message from MsWord which tells
me thar I do not have enough memory space and asks me if I want to continue.
If I clicked Yes Word crashes !!! I don't understand the problem at all.
Thanks in advance for your help. If you need to test this Macrowith my
document, don't hesitate to write me and I will send it to you.
Reagrds,
Mickaël
Sub HighLight_Actif()
Dim bkMks As Bookmarks
Set bkMks = ActiveDocument.Bookmarks
MsgBox "Test"
Dim Words
For Words = 1 To 5000 Step 1
Dim name
Dim Range As Range
name = "SIMILIS_" & Words
If bkMks.Exists(name) = True Then
Set Range = bkMks.Item(name).Range
Range.HighlightColorIndex = wdYellow
End If
Next Words
MsgBox "End " & Words
End Sub Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61198
Searching for comments
In Word97, searching for comments used ^a. This does not seem to work
for latest versions of Word. Any ideas?
Thanks
--
John Doue Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61193
How to get the temp directory of the system?
Hi everyone
How to get the temporary directory of the system, in my VBA program?
I want to create some temporary files for my operations.
Thank you! Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61187
Returning the value of a InlineShape
Hi,
I am trying to return the value of a combobox that I have inserted into a
Word document. It is not a formfield because my list needs to consist of
more than 25 members. As a result, I inserted a VBA control directly into
the document.
After doing this, I initialized the objects in the normal way, but haven't
been able to isolate the code to return the current value. I was able to
determine that controls inserted in this fashion are viewed programmatically
as an inlineshape, and so far everything points to this being correct.
Unfortunately I haven't found any documentation where the inlineshape is
anything other than a graphic object.
Could it be...
activedocument.inlineshapes(1).????
Can someone please send me in the right direction?
Desperate for help!
Thanks,
Jill Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61186
How to resize a picture?
In Word 2000 I have a macro to insert an picture that the user chooses,
select the picture , and then make the height 1" (72 pt) - keeping the width
proportional. I then want the macro to look at whether the width is greater
than 320 pt and if so, make the width exactly 320 pt - keeping the height
proportional (which means it will end up less than 1" - that's ok).
The first set of steps below work - the picture change to 1" high. The
second set of steps does not give an error message but does not do anything.
What do I need to do to make the macro resize the picture to 320 pt wide,
keeping the height proportional?
TIA,
Vivian Carroll
'SELECT & FORMAT THE PICTURE TO BE 1" HIGH - these steps work
With Selection
.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
.InlineShapes(1).Width = Selection.InlineShapes(1).Width *
72 / _
Selection.InlineShapes(1).Height
.InlineShapes(1).Height = 72
'CHANGE THE PICTURE TO BE ABOUT 3.2" WIDE IF IT IS WIDER THAN
3.2" - these steps don't work
If .InlineShapes(1).Width > 320 Then
.InlineShapes(1).Height =
Selection.InlineShapes(1).Height * 320 / _
Selection.InlineShapes(1).Width
.InlineShapes(1).Width = 320
End If
End With
End Sub Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61184
VBScript and a Merge Doc
I found the answer to this question several months ago but with the newsgroup
revamp I can't find it again so I apologise if this is the wrong place to
post this.
I am using a link to open a word application merge document, however with
the new install of MS Word the document will not open as a merge form. The
solution to this was to edit the registry entry, apparently in some patch or
another they disabled this for security reasons.
Can anyone point me at the knowledge base article, or give me the regedit
instructions for this? New machine and user and the old tech who had the
documentation is gone and so are the instructions.
Thank You
Cory Blythe Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61175
How to create route button for e-mailing a template.
I'm using Word 2003 to create a template with a route button. I want the
route button to save the document I've just filled in and automatically route
it via e-mail to 3 people without any other action necessary. I've tried to
record a macro to create the actions, but it fails. Any ideas? Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61173
just a quick question
well i went to open an attachment and when it open it look like this
þÿÿÿþÿÿÿ with smal boxes in front of the letters so how do i change
that so it can be readable? Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61166
Copying pictures from Excel to Word
Hi,
I'm trying to copy ranges of cells in Excel (on separate sheets) to Word as
picture. The pictures should appear on different pages, that is on page 1, 2
etc. Now they appear all on page 1 on top of each other. I can't figure out
what's the problem. I'll attach the code here, I'd be grateful if someone
could help me out here.
TT
------------------------
Set appWD = CreateObject("Word.Application.11")
appWD.Visible = True
appWD.Documents.Add
appWD.Selection.InsertBreak
appWD.Selection.InsertBreak
Sheets("E1").Select
Range("A1:H53").Select
Selection.Copy
appWD.Selection.PasteSpecial DataType:=wdPasteMetafilePicture
Sheets("TV").Select
Range("A1:D41").Select
Selection.Copy
appWD.Selection.GoTo What:=wdGoToPage, which:=2
appWD.Selection.PasteSpecial DataType:=wdPasteMetafilePicture Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61163
Saving Macro
I have been asked if it is possible to have a default setting when
saving a document. There are wanting the first part of each doc to
have the year/month/day then a description of some kind..is there
anyway of setting this so it defaults.
Mat Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61161
Help checking for printers in Word VBA
I have a macro that was written to extract a printer name from a custom
document property embedded in a Word file and set the printer to print
to based on that name. All of that is working just fine... my problem
comes when the printer named in the custom document property does not
exist on the current machine. Whenever this happens, I would like to
simply use the default printer on the current machine instead. I'm not
really sure how to check if a particular printer exists or not. Can
anyone help? My code is listed below... feel free to offer any
suggestions on the current working stuff too as I am a C# programmer
and the syntax here is foreign to me.
--------------------------------------------------------
Sub SubPrint()
Dim sMyActivePrinter As String
Dim iMyCopies As Integer
Selection.Collapse
sMyActivePrinter = ActivePrinter
iMyCopies = 1
For Each prop In ActiveDocument.CustomDocumentProperties
proptest = prop.Name
If proptest = "PrintCopies" Then
iMyCopies = prop.Value
End If
If proptest = "Printer" Then
ActivePrinter = prop.Value
End If
Next prop
Application.PrintOut FileName:="", _
Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=iMyCopies, _
Pages:="", PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, _
PrintToFile:=False, PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
ActivePrinter = sMyActivePrinter
End Sub Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61159
Split a Word file
Hi,
I have a need to periodically split an 8 page document
into 2 seperate files of 4 pages each. At the moment I
have to manually select this - but it is messy as I have
alot of text boxes, etc, and formatting gets screwed up.
Does anyone know of any utility or process within Word
that can split the files into 2 - I must still have .doc
file format - not pdf or any other type.
Thanks
Mat. Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61156
FAQ - Frequently Asked Questions - vba - Please read before posting - unofficial January posting
FAQ = Frequently Asked Questions - brief - vba - unofficial
This FAQ is posted weekly.- more or less
Please save us all some time by reading it before posting to the
news group.
This newsgroup is about VBA - Visual Basic for Applications -
which is the programming language for Word 97-2003 (macros).
There is a longer FAQ with more questions and links that is
regularly posted in the non-VBA Word newsgroups. You may want
to check that out as well.
--- BEFORE POSTING ANYTHING PLEASE READ THESE ---
http://www.mvps.org/word/FindHelp/Posting.htm
http://www.dts-l.org/goodpost.htm
Reading these articles will help you get a quick and meaningful
response to your question rather than just more questions for you.
It may keep your message from being screened or bounced.
A few basics, though:
(1) Be nice; everyone answering questions here is a volunteer.
(2) Post a question in only one newsgroup generally. If you
_have to_ post in more than one, post a _single_ message and
put both newsgroups in the header for that _single_ message.
(3) Do not attach anything to a message.
(4) The only really stupid question is the one you don't ask.
(5) Do not use your real email address unless you want spam.
(See bottom for sample.)
The reasons for the requests are spelled out on the web page.
A longer version of this FAQ is also on the Internet at
http://addbalance.com/word/index.htm
Newsgroup Archives:
http://groups.google.com/advanced_group_search
MVPs FAQ site: http://www.mvps.org/word/ To the extent
there is any "official" FAQ, this is it.
---
Also, before posting, you may want to look at the following
questions to see if yours is among them.
---------- ---------- ---------- ---------- ---------- ----------
1. I see a macro in a newsgroup I would like to try. How
do I add it to my template?
http://addbalance.com/word/macrosfromnewsgroup.htm or
http://www.mvps.org/word/FAQs/MacrosVBA/CreateAMacro.htm
2. What are some good books for me to read about Word?
http://addbalance.com/word/wordbooks.htm and
http://www.mvps.org/word/Tutorials/BookRecommendations.htm
3. How can I run a macro automatically when a document opens,
closes, is created?
http://www.mvps.org/word/FAQs/MacrosVBA/DocumentEvents.htm
4. How can I distribute or backup macros / customizations?
http://word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm
http://addbalance.com/word/movetotemplate.htm
5. What is an MVP?
http://www.mvps.org/word/AboutMVPs/index.html and
http://addbalance.com/word/mvp.htm
6. I need to make a form to...
Userforms are custom dialog boxes written using vba.
If you want a fill-in-the-blanks form you want what Word
calls an online form. Look in Word's help for that,
and for more info on online forms follow the links at:
http://addbalance.com/word/wordwebresources.htm#Forms
especially Dian Chapman's series of articles
If you want a custom dialog box that you code with VBA commands
you want a UserForm. Take a look at:
http://www.mvps.org/word/FAQs/Userforms.htm
7. Where can I find more information on the Web?
http://addbalance.com/word/wordwebresources.htm#webvba
http://www.mvps.org/word/FAQs/MacrosVBA.htm
http://www.mvps.org/word/FAQs/Userforms.htm
http://www.mvps.org/word/FAQs/Customization.htm
http://www.mvps.org/word/FAQs/OfficeInterdev.htm
Comments / corrections / additions may be sent to
wordfaq@no.spam.addbalance.com. Remove no.spam from the
address. (This is a "proofed" email address, I hope.)
Posted 4 January 2005
Charles Kenyon (the editor) Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61155
Printer Duplex
Hello,
I've a problem with my SetPrinterDuplex function use.
(See http://support.microsoft.com/kb/q230743)
I want to print a file with duplex option.
So, I use the function like this:
SetPrinterDuplex PrinterName, 2
Then I print with printout:
Application.PrintOut Background:=False, Copies:=NumberOfCopies (that is a
var declared upper in my code).
And then, I want to go back to no duplex settings with
SetPrinterDuplex PrinterName, 1
The problem is that the document is not printed on both side.
If I remove the last line, it works fine.
So I suppose my problem occurs because the 2nd setprinterduplex switch the
property too quickly. Is it ?
Does someone have a solution ? Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61149
macro variable scope?
Hello,
I have a macro that automatically prints documents by settings the
activeprinter and then calling printout and this macro is executed from
the command line with the /m switch.
I have a problem, however when executing several instances
simultaneously using Java threads - the documents can end up at the
wrong printers!
What is the scope of macro variables? Is it possible that they are
common and running the macro simultaneously might overwrite the values? Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61144
How Secure is Password Protection in MSWord
How secure is the password protection used in Microsoft Word 2002? If I
create a document with a list of passwords I use for banking, email, etc.
and password protect the file, is that file reasonably secure? Thanks,
Mack Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61132
can't attach to protected template
hi,
g'd morning. i made changes to a word template. i detached the old template
from word. when i attached to the new one, i got "can't attach doc. to a
protected template" error. i am working on windows xp and xp for word. does
anyone has any idea? thank you. -william.
> interesing. if i protect the doc. (go to tools menu, then protect doc.) and the code, i get the error. if i unprotect the doc., i could successfully attach the doc. to the new template. the reason why i want to protect the doc is i don't want users to change contect of the doc. directly, only via a FORM. any idea? thanks. -william
-- Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61131
Changing image size proportionately
I have an odd problem that seems like it shouldn't be a problem. Hoping
someone can help me with this.
I have some Word documents that may have images that need to be sized
programmatically. These docs are generated into Word through a
conversion from another application. The original application does not
have a reliable method of scaling the images. Consequently, some images
arrive in Word as HUGE! I noticed in Word that I could search for a
graphic (^g), open the "Format picture" dialog, click the "Size" tab,
then set the "width" to 6 inches while making sure that "Lock Aspect
Ratio" is checked.
Seemed like a good candidate for a macro, especially since I want to do
this automatically as part of the conversion process.
The problem is that I can not seem to resize these pictures
proportionately through VBA like I was able to do it manually. This
does not seem right since my understanding is that I should have MORE
control over my document w/ VBA rather than LESS.
When I recorded my actions as a macro then examined the code it showed
my height and width expressed as a no. of pixels. Since I want to limit
my images to 6 inches wide, 432 pixels is perfect (6 in. * 72 dpi).
However, I don't know the original dimensions of the images. I only
know that I don't want them displayed any wider than 6 inches.
Here is my code:
Public Sub testfind()
x = 0
g = ActiveDocument.InlineShapes.Count
For i = 1 To g
ActiveDocument.InlineShapes(i).Select
If Selection.InlineShapes(i).Width > 432# Then
Selection.InlineShapes(i).Line.Visible = msoFalse
Selection.InlineShapes(i).LockAspectRatio = msoTrue
Selection.InlineShapes(i).Width = 432
End If
Next i
End Sub
When I step through this w/ F8 it sets "g" to 58 and goes through the
IF statement once fine. When "i" is 2 the macro fails on the IF
statement. I get an error message that says: "The requested member of
the collection does not exist." This doesn't seem right since there are
58 members of the collection. Why does it fail on no. 2?
When I go to check InlineShape(1), which is >432, I find that the
height is still at the original dimension, even though I have
LockAspectRatio marked as checked. What is the magic incantation to
make the height change proportionately to the width that I've
specified? TIA Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61124
selecting text
How do you control the speed that text can be selected? For example, I
can easily select (drag over) any portion of text that appears on my
screen but the the second I try to continue to select text above or
below the current screen, the speed of the drag/selection is too fast
to control. I cannot stop it where I want to. I have been through all
the MS Word Help topics within the software and cannot locate anything
about this. Thank you.
Chuck Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61123
Text input in a password protected document
The following macro is captured from a word document to open another word
document that is password protected and then input text into some form
fields
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 01/03/2005 by Hlam
'
ChangeFileOpenDirectory "F:\FIN\Invoice and Authorization Letter\"
Documents.Open FileName:="""Reg Signing.doc""",
ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
Selection.TypeText Text:="test1" ' a tab key to move to
another field not captured in macro??
Selection.TypeText Text:="test2"
Selection.TypeText Text:="test3"
Selection.TypeText Text:="test4"
ActiveDocument.Close
End Sub
But when I tried to run this macro to do exactly the same thing it gives me
the message"
"This method or property is not available because the object refers to a
protected area of the document"
Does it mean text has to be input manually, VBA input is not supported in a
protected document?
This document is created from our headquarter that has no password given to
unprotect. Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61122
Drop Down Lists
I am new to VBA. I have a document that is 27 pages long and has approximately 150 drop down fields. The drop down fields will all contain the drop down items. Instead of manually entering the 4 values to each drop down field, how do I set up a macro that will autopopulate all of the drop down boxes with the same information.
Thanks !
S~
--
Message posted via http://www.officekb.com Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61119
Please help! Error 5101 Bookmark does not Exist--but it does
I am updating an MS Word document from MS Access, below is my code. The
following statement works when I have a reference to the VBA Microsoft Word
Object Library 10.0 in Access set, but I receive Error no: 5101 â??This
bookmark does not existâ??.
when I uncheck the Microsoft Word Object Library 10.0 reference in Access
VBA: (reference ** in code)
appWord.Selection.Goto What:=wdGoToBookmark, Name:="IIIA1"
I wish to use late-binding in this application so it will work more
universally. What is wrong with this statement?
Also, will the next 2 statements work without modification?
Is there a source for MS Word error no. descriptions? Also, where can I
read more about Word objectsâ??what they are and how to use them?
Thanks for your assistance!!
Alan
ACCESS CODE FOLLOWS:
â??DECLARE VARS
Dim appWord As Object
Dim Docs As Object
â??OPEN MW WORD AND DOCUMENT
strSched = "C:\Templates\Document.dot
Set appWord = GetObject(, "Word.Application")
Set Docs = appWord.Documents
Docs.Add strSched
â??GOTO BOOKMARK AND HIDE TEXT
** appWord.Selection.Goto What:=wdGoToBookmark, Name:="IIIA1"
appWord.Selection.MoveRight Unit:=wdCharacter, Count:=198,
Extend:=wdExtend
appWord.Selection.Font.Hidden = True
â??QUITE MS WORD AND RESET DIM VARS
appWord.Quit
Set appWord = Nothing
Set Docs = Nothing Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61113
Vb.net and VBA
I started getting lessons in VB.net, and my main purpose is to be able to
write code in Microsoft Office application like Word and Excel. But as I
understand that VB.net in not a continuation of VB6 but differ entirely.
My questions is:
Is there any difference in the language itself. and
Shall the newer version of Office use VB.net.
--
Microsoft Biased Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61106
Macro
I want to create a macro but i am not sure what programming language is used
to create one. Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61105
Riddle me this
Hi,
I have a snippet of code that applies superscript font:
oWord.SetRange Start:=oWord.Start, End:=oWord.End + 1
oWord.Select
'oWord.Font.Superscript = True
Selection.Font.Superscript = True
I don't understand why I have to select the range and then apply the
formatting to the selection. In another macro I have this code
ActiveDocument.Range.Font.Superscript = True
which I am using to try to solve this riddle. Isn't oWord a Range like
ActiveDocument.Range? Why doesn't oWord.Font.Superscript = True work like
ActiveDocument.Range.Font.Superscript = True
Here is my complete code:
Sub ScratchMacro1()
Dim oPara As Paragraph
Dim oWord As Range
Dim i As Long
Dim myWord As String
Dim mySeq As String
myWord = InputBox("Enter the word to find.")
mySeq = myWord
For Each oPara In ActiveDocument.Paragraphs
i = 0
For Each oWord In oPara.Range.Words
If Right(oWord, 1) = " " Then oWord.MoveEnd Unit:=wdCharacter,
Count:=-1
If LCase(oWord) = LCase(myWord) Then
i = i + 1
oWord.Collapse Direction:=wdCollapseStart
'insert field, reset sequence to 1 for first occurence in paragraph
If i = 1 Then
oWord.Fields.Add Range:=oWord, Type:=wdFieldEmpty, Text:= _
"SEQ " & mySeq & " \r1", PreserveFormatting:=True
Else
'insert field
oWord.Fields.Add Range:=oWord, Type:=wdFieldEmpty, Text:= _
"SEQ " & mySeq & "", PreserveFormatting:=True
End If
'superscript the sequence number
oWord.SetRange Start:=oWord.Start, End:=oWord.End + 1
oWord.Select
'oWord.Font.Superscript = True
Selection.Font.Superscript = True
End If
Next
Next
End Sub
Thanks
--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61095
Paragraph Mark
Hi,
Can anyone tell me if there is a Chr(?) you could use for
a paragraph mark. I know Chr(9) is for a tab, but is
there one for a paragraph return?
Thanks to all. Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61091
print on a folded 8X5 card
I need to print a top fold 8X5 card using Windows ME Tag: How to serach breaks of sections, columns or text wrappings? Tag: 61088
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?
Re: How to serach breaks of sections, columns or text wrappings? by Jay
Jay
Thu Jan 06 11:26:21 CST 2005
and wrote:
> 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
Place these codes in the .Find.Text string:
^b section break
^n column break
^11 text wrapping break