Limiting Document Size?
Hi all. I am new to VBA programming in Word. Here is my problem. I
am sending out a form for various people to fill in. What I am
looking for is a way to limit the total size of the document to 2
pages. Can this be done, and if so, HOW?
Thanks. Tag: how to use dot net(macro) in MS word to create a macr Tag: 98199
Combo Boxes
I've search throught related discussions and cannot find quite what I'm
after. I've created a drop down form field with three Department Names.
Let's say they are Dept's A, B and C. Based on the seletion I would like
combobox1 to load with the corresponding list of employees who are maintained
on an Excel spreadsheet. Column A of the spreadsheet contains the employees
for Dept A, Column B contains a list of employee for Dept B and so on. Thus,
when the user select Debt A in the drop down box, the combobox1 would
popluate with the employees for Dept A from the Excel spreadsheet name
EmployeeList.xls.
Any help would be much appreciated. Tag: how to use dot net(macro) in MS word to create a macr Tag: 98196
Invoke builtin Smarttags or builtin paste-method
Hello!
I have written a tool to protect bookmarks from changes.
One measure to achieve this is to monitor *all* copy-, cut- and
paste-actions.
So I changed all of these actions (by menu / context-menu / toolbar-icon /
hotkey) to run into my tool:
if bookmarks would be affected it does some tricks and things and if not the
"normal" action takes place.
Now there arises a problem committing the paste-action:
I always had thought the method "Word.ActiveWindow.selection.Paste" to do
exactly the same as the "normal, builtin Paste" that Word does.
But that´s not true - the "normal" default-paste does even more!
Just enable "Show Paste Options buttons" in Tools -> Options -> Edit.
Then after each paste-action Word shows a Smarttag enabling the user to
decide whether to keep or to discard the pasted texts formats.
When I use the paste-method from within VBA this Smarttag does *not* appear.
So apparently the "normal" default-Paste in Word must consist of more than
just the Paste-method.
Does anyboday know how to do one of the following in VBA-code?
- invoke Words own builtin Paste-method
or
- show Words own builtin "Show Paste Options buttons"-Smarttag
I´d be ever so thankful for a hint because it would be quite irksome to
re-build an already builtin function by hand.
Best regards!
Harald Dehner Tag: how to use dot net(macro) in MS word to create a macr Tag: 98193
change the color of the visited hyperlink
Hi all
I would like to change the default color of visited hyperlink in VBA.
Is that a way that I could control each hyperlink visited color ??
Or I have to set it for all hyperlink?
Many thanks Tag: how to use dot net(macro) in MS word to create a macr Tag: 98191
Linking two or more fiiles together
Using Windows XP and Office Professional 2007. I have a large number of
files that act like a table of contents and documents. If inside one file I
could use bookmarks to go from the TOC to the correct text. I probably need
some sort of macro to go between files? Anyone know anything about such
macros? Tag: how to use dot net(macro) in MS word to create a macr Tag: 98190
converting a file
How do I convert a file from a .tif (from a scan) to a pdf file? Tag: how to use dot net(macro) in MS word to create a macr Tag: 98187
Create drop down list within an already created macro through VBA
Hi there -
I have some VBA experience, but am not an expert. I need to create a drop
down form field within an alreay created macro. I'm assuming the only way to
do this, if possible, would be through VBA. Any suggestions would be much
appreciated!
--
Thanks in advance for your help!
Amy Tag: how to use dot net(macro) in MS word to create a macr Tag: 98174
How do I modify custom icons in 2007?
I was using Word 2002, and had several toolbars containing icons for starting
my macros. Having upgraded to 2007 my icons have moved to the Add-Ins ribbon.
That's fine with me, but how do I edit those icons?
--
Stephenc Tag: how to use dot net(macro) in MS word to create a macr Tag: 98168
How to find a paragraph style in a Wd 2003 table
Hi,
We have a legacy template (Word 2000) that uses paragraph styles in tables
(as that was the only way you could have table styles in 2000.). We also
have code that processes documents and looks for styles. In this case the
style is TFN (Table Footnote). If there is text w/i the cell tagged as TFN
then Selection.Find.Style = "TFN" will find the cell. However, if the celll
is empty (but the end of cell marker is tagged as "TFN") then selection.find
will not find the para/cell.
Is there any way to find "empty" paragraphs w/i tables using selection.find?
I can use:
Dim tblRng As Range
Dim tbl As Table
Dim para As Paragraph
For Each tbl In ActiveDocument.Tables
Set tblRng = tbl.Range
For Each para In tblRng.Paragraphs
If para.Style = "TFN" Then
para.Range.Select
MsgBox para.Style
End If
Next para
Next tbl
But this is rather more complicated than simply running a selection.find on
the "TFN" style. I'm trying to avoid having to hunt through several hundred
macros to replace all of our legacy code.
Thanks in advance!
Steve
--
Steven Lee
Vaporloop Technology Solutions Tag: how to use dot net(macro) in MS word to create a macr Tag: 98161
Duplex Printing VBA Code
Hello all,
I've got a Word 2003 document that I'm trying to create Word VBA code
for, simply to tell it which printer to go to, and to print Duplex 3
(vertical binder.)
I'm still in the early stages of learning the ropes - so I've been
unable to get a macro to fire off when the document gets opened by
another application, (i.e. sdOffice,) and sdOffice tells Word to
perform a Mail Merge with that doc. This is in a Template document
(.dot extension.) I was hoping that when the Mail Merge happens, it
would fire off an event to set the printer to P987, and Duplex 3. But
I'm obviously missing something. I get no message box...
I found and tried Jonathan West, MVP's solution From:
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=116
= Controlling the Printer from Word VBA
Sub PrintDuplexBooklet()
Dim iDuplex As Long
iDuplex = GetDuplex 'save the current setting
Set Duplex 3 'set for vertical binding
ActiveDocument.PrintOut Background:=False
Set Duplex iDuplex 'restore the original setting
End Sub
But I'm not clear on: When the sdOffice application opens the
document, does the Mail Merge, what event can I use to call this
PrintDuplexBooklet procedure?
Be it known, I've already sacrificed a chicken. I hope that helps at
least a bit :) Does anyone have a suggestion of a really good Word
VBA for Dummies - type book? (I'd like to find substantially more
comprehensive than the Dummies series, but still clear for
beginners!)
Thanks for the help !!!
Cole Tag: how to use dot net(macro) in MS word to create a macr Tag: 98157
create string from checkboxes in userform
Hello,
I currently have a userform in excel that has several checkboxes for the
user to select. The checkboxes then apply a string value if the user
selects the checkbox (ie. If chkbox.value = -1 then strname = "something"
else strname = "" ). The values are then placed into the active cell in
which the form was called.
What I want to do is create a string, separated by a delimiter, and place
the entire string into the active cell as the value. Currently, I have the
string put together, but it inserts delimiters even if there is no value.
For example, If I have four checkboxes, and only 2 are selected, then the
string value looks like ,,value,value .....What I would like to accomplish
is to put together the string of only checkboxes that are selected, and not
have values inserted into the string for blank values, or checkboxes that
have not been selected.
Any help is most appreciated.
Thanks Tag: how to use dot net(macro) in MS word to create a macr Tag: 98149
Customization Context causing error when not set to NormalTemplate
Hi All,
I have an autonew macro in a couple Word 2003 templates that creates a menu
that is visible when the end user is a document based on that template.
The reason I need to create the menu programmatically is because they have
Adobe Acrobat installed and it keeps trashing menus that I create /out VBA in
the template.
I had set the customization context to the document being created because
this made it appear only when the user was in the document. It works fine on
9 out of 10 computers in our office.
However, on one computer, each time I use the template, when I close the
doc, I get a runtime Error that mentions WinWord.exe and says
"The application has requested the runtime to terminate in an unusual way."
It then immediately kills word and any open docs are closed without saving.
If I set the customization context to NormalTemplate after creating the
menu, I do not get the error. However, that makes my menu disappear. If I
use NormalTemplate all along, the menu then shows in ALL documents. (Not
good.)
For now, I made an AutoClose macro that sets the customization context to
NormalTemplate as they close the document and all is well. BUT I'm wondering
if anyone has seen this? Any ideas what could cause it? Am I even
approaching my menu issue the right way?
Thanks so much. Tag: how to use dot net(macro) in MS word to create a macr Tag: 98143
Applying Field Formatting Automatically in Word 2003
I'm using Word 2003 and trying to populate fields with data using
result.text=<Data>. So if wdField is a Word.Field object that I want to
populate I use wdField.Result.Text=<Data>. It puts the data in there, but
when I enter data into a formatted field like a date field, the formatting is
not applied unless I arrow through the fields in the document - when the
field is exited, the formatting is applied correctly. Is there a way to get
this format applied when the data is entered? I tried using wdField.Update,
but that didn't do it.
Thanks,
Dave Tag: how to use dot net(macro) in MS word to create a macr Tag: 98141
Protect Styles without restricting Character Formatting in 2002 &
What I'm trying to do is keep wacky paragraph styles from other
documents from being pasted into our official company documents.
In Word 2003, I am able to set the Styles Protection and only allow
certain paragraph styles to be pasted in. Any other styles get forced
to Normal style.
What I just discovered is that this is unsupported in Word 2002, and
we've got almost an even split of 2002 & 2003 users here.
I've also discovered that that when I turn on Styles Protection in 2003, it
then doesn't allow me to do any character formatting either (bold, italic,
underline, etc.).
Is there a way to set Paragraph Styles Protection yet still allow Character
Formatting in both 2002 and 2003?
THANKS,
Matt Tag: how to use dot net(macro) in MS word to create a macr Tag: 98140
Heading Format
In my document I have setup my Headings as follows:
1.0 Heading 1
1.1 Heading 2
a. Heading 3
Is there a way to write a macro that will change how Heading 3 is displays
so when I start going through the alphabet a second time it displays it as:
aa, ab, ac instead of: aa, bb, cc? Tag: how to use dot net(macro) in MS word to create a macr Tag: 98138
Using Macros In Forms
I am trying to create a macro that will permit use of the ENTER key to
navigate between form fields created in MS Word 2003 instead of the detault
TAB key. I have followed KB articles 212536 and 211219, but nothing seems to
work.
Is there an easier way or am I just missing something?
--
Rick Tag: how to use dot net(macro) in MS word to create a macr Tag: 98135
Acrobat Add-in is not loaded when I open a document programmatical
Hi! Here's my problem: when I programmatically convert Word documents to
PDF via Print to PDF driver, the resulting PDF does not contain embedded links
found in original Word documents. I figured if I find a way to execute
â??Adobe PDFâ?? -> â??Convert to Adobe PDFâ?? option of Acrobat Add-in, I can solve
the problem of missing links.
When I open the document manually, I can see the â??Adobe PDFâ?? option on the
menu bar. When I open the document programmatically, the menubar does not
contain â??Adobe PDFâ?? option. As a result, my code can not execute.
I also tried to execute the macros directly from my C# WinForm application
but was getting Unable to Execute Macro exception which I am sure is related
to the aforementioned problem.
Application.Run MacroName:="AdobePDFMakerA.AutoExec.Main"
Application.Run MacroName:="AdobePDFMakerA.AutoExec.ConvertToPDF"
Hereâ??s how I open Word documents in code:
private Word.ApplicationClass wordApp = null;
. . . . . .
doc = wordApp.Documents.Open(
ref objOrgDoc, //FileName
ref objMissing, //ConfirmVersions
ref objMissing, //ReadOnly
ref objMissing, //AddToRecentFiles
ref objMissing, //PasswordDocument
ref objMissing, //PasswordTemplate
ref objMissing, //Revert
ref objMissing, //WritePasswordDocument
ref objMissing, //WritePasswordTemplate
ref objMissing, //Format
ref objMissing, //Enconding
ref objMissing, //Visible
ref objMissing, //OpenAndRepair
ref objMissing, //DocumentDirection
ref objMissing, //NoEncodingDialog
ref objMissing //XMLTransform
);
What can I do to execute the menu option programmatically? What am I doing
wrong?
Is there a way to force Adobe to â??show upâ???
Word 2003, Acrobat 6 & 7
Many thanks in advance,
--Michael Tag: how to use dot net(macro) in MS word to create a macr Tag: 98133
Duplex Macro
Hello computer gods and goddesses,
I've got a Word 2003 document that I'm trying to create a VBA macro
for simply to tell it which printer to go to, and to print Duplex 3
(vertical binder.)
I'm still in the early stages of learning the ropes. But I've been
unable to get a macro to fire off when the document gets opened by
another application, (i.e. sdOffice,) OR when a Mail Merge occurs...
My sorry attempt at coding this follows. This is in a Template
document (.dot extension.) I was hoping that when the document was
opened, it would fire off this event and do my procedure. But I'm
obviously clueless. I get no message box...
Sub Document_Open()
ActiveDocument.PageSetup.Orientation = wdOrientPortrait
ActivePrinter = "P9638" 'This is temporary to send this doc
to
'the printer near IT
MsgBox ("active printer is " & ActivePrinter)
End Sub
I've also tried: Sub Document_New() thinking it's creating a new doc
from the Template that this code is within.
Be it known, I've already sacrificed a chicken. I hope that helps at
least a bit :) Does anyone have a suggestion of a really good Word
VBA for Dummies - type book? (I'd like to find substantially more
comprehensive than the Dummies series, but still clear for beginners!)
Thanks for the help !!!
Cole Tag: how to use dot net(macro) in MS word to create a macr Tag: 98127
Comments/Annotations and Track changes (toggle back and forth)
Hello,
Is there a built-in function within Word 2003 to hide comments and only
display track changes or vice versa?
--
Smile...it is good for you! :) Tag: how to use dot net(macro) in MS word to create a macr Tag: 98125
Replace words or phrase in multiple documemts
Hello,
I have about 800 documents and I want to be able to find words or phrase and
replace with another phrase. Is there an easy way to handle this using a
macro?
Thank you!
--
Smile...it is good for you! :) Tag: how to use dot net(macro) in MS word to create a macr Tag: 98124
Force wdPrintDocumentWithMarkup
I'm showing the wdDialogFilePrint, but I would like to force
wdPrintDocumentWithMarkup. I tried something like:
Set didPrint = Dialogs(wdDialogFilePrint)
didPrint.Display
didPrint.Item = wdPrintDocumentWithMarkup
didPrint.Execute
but that doesn't work. :/
All the help I've seen suggests that I can only use
wdPrintDocumentWithMarkup with PrintOut. If true, will PrintOut use
the settings I've captured in the didPrint Dialog object? Tag: how to use dot net(macro) in MS word to create a macr Tag: 98122
Need macro to set all pictures in document to a certain size
Hi,
i need a macro to set all pics to a certain size (in this case 4.5cm high
and 2.81cm wide).
I have tried resizing the pictures to the desired size manually first but
its no good because i cant find a prgram to do it that is free and doesnt
have limits on quality or amount of pictures in batch.
I already have a macro to resize all pics to a percentage of the original
size, so if you just tell me how to set an absolute size I can adapt that.
thanks Tag: how to use dot net(macro) in MS word to create a macr Tag: 98111
Field code to jump to a specific page (Without using bookmarks)
I know that I can embed a bookmark on a specific page and then
create a field code with a PageRef with a hyperlink. But I am looking for
a way to use a field code with a hyperlink that does not rely upon bookmarks.
Example: Page 12
The "12" would consist of a field code with a hyperlink to page 12.
Thanks in advance for all help.
--
Tim Tag: how to use dot net(macro) in MS word to create a macr Tag: 98109
copying images via CopyAsPicture with different image sizes
Hi,
when copying my selection in Word via CopyAsPicture i got different
types in my clipboard
(thats ok, I got "gif", "png", "emf" ...)
It seem as if they were copied with different dpi settings, because
they have different sizes.
clipboard type "gif" seems to have 96 dpi, "png" 150 dpi
is there any chance to change these dpi settings?
I think, the setting for gif is in DefaultWebOptions or WebOptions.
But where can I change the setting for PNG
thanks,
helmut Tag: how to use dot net(macro) in MS word to create a macr Tag: 98100
How to make an in-memory clone of a word document
Using VB6 I have a requirement to create a separate copy of an in-memory word
document on disk (for subsequent processing) without writing overwriting the
original file or changing the name fullpath of the active document(cannot use
.save, this overwites the original, cannot use .saveas as this changes the
filename and this cannot be changed back to the original as .Fullname is a
readonly property).
So, what I though was to clone the document in memory and save the clone to
a temporary file. I have some proof of concept code that appears to work but
what I am worried about is that I am not copying the all the document and .
I see I have to copy the content, the builtindocumentproporties and the
customdocument properties.
Is there anything else that needs to be copied to make sure I have
everything (forms, scripts or whatever)?)
Here is my POC code:
Public Sub CopyDoc(docSource As Word.Document)
Dim docDestination As Word.Document
Dim i As Integer
Dim strProperties As String
Set docDestination = docSource.Application.Documents.Add
docDestination.Content.FormattedText = docSource.Content.FormattedText
' TODO:Temporary exception handler to cope with unset properties
On Error Resume Next
For i = 1 To docSource.BuiltInDocumentProperties.Count
docDestination.BuiltInDocumentProperties.Item(i) =
docSource.BuiltInDocumentProperties.Item(i)
Next i
' TODO: Custom properties
docDestination.SaveAs ("c:\junk1.doc")
docDestination.Close
Set docDestination = Nothing
End Sub Tag: how to use dot net(macro) in MS word to create a macr Tag: 98098
timers help
does anyone know how to insert a clock or timer in a word form document so
users can see a basic stop watch Tag: how to use dot net(macro) in MS word to create a macr Tag: 98096
Enable/disable macros when none in document
Hi
I created a document with some vba code in it for testing. Now that I
checked it works, I have put the code in normal.dot and removed the module
from this document. However, whenever I open it, I still get the macro virus
warning asking me whether I want to enable or disable macros. I don't get
this with other documents, so how do I stop it happening with this one
please?
(Word 97)
Thanks
GB Tag: how to use dot net(macro) in MS word to create a macr Tag: 98091
Form and Macro Problem
I currently have a problem that seems simple but is not in Word and don't
know if it can be done. I'd appreciate any feedback anyone here may have
that may clarify for me if this can even be done in Word and if not, I'm
pretty sure I can do it in Excel, but the person I'm working for wants it in
Word if possible.
What I have are 4 documents (forms). They are all similar in nature in that
they are all 2 column forms with the left column content always staying the
same except for the variable form fields that will change according to the
client selected, but the right column would be defined by a dropdown box in
the left column that when choosing one of the options from that box, the
right column would change content to the other form data.
In case I'm not stating this clearly, I have posted a jpg kind of laying out
what I need. If any more clarification needs to be made, just let me know.
This is a little out of my range, but was hoping that maybe using VB there
was a way to do this.
Here is the sample using 2 of the forms. The other two are similar in that
the left column stays the same so the information doesn't need to be
repeated from page to page. They do not want a 4 page document. I figured
out how to run a macro and import the information from another file into
that column, but once I assigned a macro to the drop down box selection, I
was no longer able to lock the form, which is crucial. I need the content
in the change order to change only in the right side of the page and was
hoping a macro or programming of some sort would allow me to do this in
Word. Now I do the macro assigned to a button and I get vb runtime errors.
http://www.eliteofficesupport.com/clients/sample/
Thanks for any direction or assistance,
Lily Tag: how to use dot net(macro) in MS word to create a macr Tag: 98086
Separate where there is "#"
Hey all,
Quick question I hope.
I have a word doc with two columns. We click a button to copy data out of a
program and then we paste it into the word doc. At a certain point in the
data there is a # which separates numerical data from the notes.
What I want to do is have the data separate at the #. The portion before
the # going to column 1 and the portion after going to column 2. Thanks very
much for any insight you can offer.
James O Tag: how to use dot net(macro) in MS word to create a macr Tag: 98085
Email from word...
This isn't the regular email from word question.
I use word 2003.
File > Send to > Mail recipent
Opens up an outlook style top bar,
I'd like to be able to make that appear using VBA, with the TO
dialogue filled in automatically from a textbox on my userform.
Is this possible?
This is what I'm talking about btw:
http://www.99cones.co.uk/outlook.jpg Tag: how to use dot net(macro) in MS word to create a macr Tag: 98082
dynamic drop downs
I trie d this code:
Private Sub Project_Change()
If Image.Text = "IPSD Base" Then
Project.List = Array("NA")
Else
If Image.Text = "CPSE Base" Then
Project.List = Array("NA")
Else
If Image.Text = "CPSE Development" Then
Project.List = Array(" ", "AMA", "ATHN", "Feller", "Future
Phoenix", "Janus", "K700", "KMS", "MEGA", "PSD", "SEBR")
End If
End If
End If
End Sub
It compiles ok, but is not dynamic. Basically, 2 drop down boxes,: "Image"
and "Project". I would like the choices in "Project" to be dependant on the
choice in "Image" Tag: how to use dot net(macro) in MS word to create a macr Tag: 98077
How do I search for a bulleted list?
I need to search for bulleted list items in a document, and replace them with
a specialized style. The items currently have no unique formatting or styles
attached to them. Is there some way to search for "bulleted list"? Tag: how to use dot net(macro) in MS word to create a macr Tag: 98073
Reading from closed excel file into word form and writing data to closed excel file
Hi,
Was wondering if anybody could help. In the Initialise_Form subroutine of a
word macro, I would like to read data (a number) from a single cell in
Excel, insert it as the caption of a label box (so that the data cannot be
altered by the user), then add 1 to the number in the cell in Excel and save
the worksheet, all without opening the worksheet. This will ensure that
each time the form is initialised, it will have a unique number. The reason
why I would like to use Excel is that there will be a number of users
initialising forms. I have seen the excellent tips on the MVP website (and
have used them to load a listbox from an excel range for another part of the
form), but cannot find anything directly on point. I would like to know
whether saving data to a closed Excel file can be done. Any help would be
appreciated.
Many thanks,
Kym Tag: how to use dot net(macro) in MS word to create a macr Tag: 98064
Hijacking a Word command
Greetings,
I want to make the ActiveDocument.SendMail command conditional when the
File>Send to>Mail recipient as attachment command is chosen.
How do I "hijack" it into a Word macro for conditional manipulation before
sending it to Outlook?
My purpose is give the party sending the doc an option to change the
template to Normal using the code
With ActiveDocument
.UpdateStylesOnOpen = False
.AttachedTemplate = "Normal"
End With
or to send it as is.
Thanks in advance,
Israel Dalven
Technical Writing
Flash Networks Tag: how to use dot net(macro) in MS word to create a macr Tag: 98060
Application.OrganizerCopy does not work correctly in Word 2007
Hi,
I would like to copy a format-template from a DOT-File into the
ActiveDocument.
In Word 2003 the folling VBA-Code works fine:
-----------------------------------------------------------------------------------------------
Sub TestOrganizerCopy()
source1 = Options.DefaultFilePath(wdProgramPath) & "\StartUp\DATA5.dot"
destination1 = ActiveDocument.FullName
Application.OrganizerCopy Source:=source1, Destination:=destination1,
Name:="AbsatzNummer", Object:=wdOrganizerObjectStyles
End Sub
-----------------------------------------------------------------------------------------------
In Word 2007 this code works also fine, but only if the ActiveDocument is
stored on the local filesystem.
If the ActiveDocument is stored somewhere on a fileserver the code produces
a error that tells you, that the active document is already open.
The system seems to block itself.
Does anybody know a solution, how to solve the problem?
Thanks for help.
Regards
Karl Zuern / DATA 5 GmbH Tag: how to use dot net(macro) in MS word to create a macr Tag: 98059
How to ceate in VBA a word table in a document tutorial for dummie
Hi,
I'm a dummy.
Is there somewhere a dummies guide to creating a table using VBA in a word
document that explains what you do and what is being done at each step.
I have a recordset i wish to place in a table with two columns centrally on
the page.
Fixed distance from the top columns so wide then merge the data into the
table.
I cannot find a how to for dummies anywhere.
There are examples etc but not what is actually being done.
Any pointers to web pages etc really appreciated so I can learn to do it
myself.
--
Regards
Bill Tag: how to use dot net(macro) in MS word to create a macr Tag: 98058
Office XP Professional Word 2002
My wife has Office XP Professional with Word 2002. Two weeks ago she noticed
that she no longer had the Edit tab in her Menu Bar as well as the Ruler was
now in Character spacing instead of inches. I have fixed the Ruler but have
not been able to restore the Edit tab inspite of running the Fix and Repair
proceedure in Help; using the Add/Remove/Change in the Control panel;
Un-install/install preceedure and replacing the Data file in the Registry. I
believe this happened during one of the updates but she does not remember
exactly when and did not establish a restore point. Any help is greatly
appreciated.
--
Henry Senior Tag: how to use dot net(macro) in MS word to create a macr Tag: 98054
Character by character search for direct formatting
Hi,
Forgive my ignorance but I am new to Word Programming.
I need to be able to search a document character by character. If the
Character is formatted as "Dark Blue" in colour I need to extract the
character from the source document to a new document (target) and continue
search and extract until the end of the source document is reached.
I know this request may sound a bit odd, so here's the reason why.
I've written a book (approximately 280000 words - 640 pages) and I want to
be able to extract just the Dialogue (enclosed by single quotation marks and
formatted in Dark blue, so that it stands out from the narrative)
The entire source document is written in font : Times New Roman, regular, 12
point
I have only used the "normal" paragraph style.
The situation is complicated by that the fact that only part of any given
paragraph may be dark blue (dialogue) which the rest is Black (narrative)
What I'm hoping for is a single target document that contains just the
dialogue (Dark Blue text)
Any thoughts on this conundrum would be much appreciated.
Mnay thanks Tag: how to use dot net(macro) in MS word to create a macr Tag: 98047
Protected text moves when I type into form
I have written a form in which I need to put information in the text
fields. I have protected the form, but the protected headings move as
I type the information in. This puts all the in out of sinc. The
headings move off of the line and down the page.
Thanks for any help. Tag: how to use dot net(macro) in MS word to create a macr Tag: 98043
Run Macro automatically when files get open
Dear Sir,
I have created macro name auto_open in word which finds & replaces text.
I wanted to run this macro at the time when file opens.
thnks
rupesh. Tag: how to use dot net(macro) in MS word to create a macr Tag: 98042
Is it possible to write a wizard in VBA
I'd like to use VBA to write a wizard that handles a series of conditionals.
If this then display that; with next and previous capability. Is this
possible in VBA please?
TIA
Philip Tag: how to use dot net(macro) in MS word to create a macr Tag: 98038
Search for textboxes
I recently moved a text box around in a word file and somehow it
disappeared. Can I ask Word to search for text boxes in a document via
VBA?
Help is appreciated. Thank you very much in advance.
Regards,
Andreas Tag: how to use dot net(macro) in MS word to create a macr Tag: 98027
Convert INCLUDEPICTURE text strings to Word fields with curly braces around the text string
Hi everyone
>From a Filemaker database, I produce a Word document with exam
questions.
Some of the questions have images (diagrams). A text reference for
each image arrives in the Word document as a paragraph, with the
content required for a linked picture field. For example:
INCLUDEPICTURE "http://www.homepage.mac.com/itraining/iQ/24487.jpg
What I need is a macro to run through the document and convert the
INCLUDEPICTURE text string to a proper field, so the image is viewable
in Word. I am hopeless at VBA and have been unable to nail this with
my very limited Macro skills. Basically I need the opening and closing
"curly braces" to encompass the text string. Three examples are shown
below with live images that are accessible via a web browser:
Question 10
INCLUDEPICTURE "http://www.homepage.mac.com/itraining/iQ/24487.jpg"
Question 11
INCLUDEPICTURE "http://www.homepage.mac.com/itraining/iQ/24405.jpg"
Question 12
INCLUDEPICTURE "http://www.homepage.mac.com/itraining/iQ/22031.gif"
Any help would be greatly appreciated.
Thanks in advance.
Michael Richards
Brisbane (Australia) Tag: how to use dot net(macro) in MS word to create a macr Tag: 98025
Text replacement
I have the following macro that finds the word â??Orderâ?? and changes it to all
caps and bold in the whole document. How do I change it to just replace it in
my ActiveDocument.Styles "Heading 1", "Heading 2", "Heading 3" and "Heading
4"?
Dim SearchRange As Range
Set SearchRange = ActiveDocument.Range
With SearchRange.Find
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.Format = True
.Wrap = wdFindContinue
.Replacement.Font.Bold = True
.Text = "Order"
.Replacement.Text = "ORDER"
.Execute Replace:=wdReplaceAll
End With Tag: how to use dot net(macro) in MS word to create a macr Tag: 98023
Convert Table to OLE Word Document
Hello all,
I've got a VBA function that attempts to take a word table, select it,
cut it, and then create a Word OLE object where the table used to be,
then pastes the table into the Word OLE. I need this for a program I
work with that doesn't play nice with Word tables.
The code is below, and it works in Word 2003, but it will not work for
all tables in a larger document. I'm not sure why, and was wondering
if anyone had any ideas.
Thanks in advance!
Sub ConvertTablesToOLE()
'
'Move to top of document
Selection.GoTo What:=wdGoToPage, which:=wdGoToFirst
'Get count of tables
Dim tCount As Integer
Dim i As Integer
tCount = ActiveDocument.Tables.Count
i = 1
While i <= tCount
Selection.GoTo What:=wdGoToTable, which:=wdGoToNext 'go to first cell
of next table
Selection.MoveUp Count:=1
Selection.EndKey
Selection.TypeParagraph
Selection.MoveDown Count:=1
Selection.Tables(1).Range.Select
Selection.Cut
Selection.MoveUp Count:=1
'Create OLE, paste into it
Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.8",
FileName _
:="", LinkToFile:=False, DisplayAsIcon:=False
ActiveWindow.Selection.Paste
ActiveWindow.Close
i = i + 1
tCount = ActiveDocument.Tables.Count 'We now have one less table, so
tCount gets updated
Wend
End Sub Tag: how to use dot net(macro) in MS word to create a macr Tag: 98018
Auto-Prompts for Form
I have a fax cover sheet that I created using Word 2003. I want to set up
prompts that would prompt the user with a dialog bog and then he/she would
fill in the appropriate information and then it would populate the
corresponding portion of the form. Does anyone know where I can find a
tutorial for this task?
Thank you in advance, Karen Tag: how to use dot net(macro) in MS word to create a macr Tag: 98013
Saving data from forms created in 2003 in 2007 version
In 2003 - you could extract data from forms using requesting to "save data
only" and then save the file as a plain text document - Data was saved and
separated by commas for easy export to other programs - I can NOT seem to get
this to work in the 2007 version - Any assistance would be greatly
appreciated. Thanks Tag: how to use dot net(macro) in MS word to create a macr Tag: 98008
Skip Compile
Hello
OS: Windows XP
App:Word XP
Can I mark a section of VBA that will not be compiled?
Why? I want to include Word 2003 Compatibility Options in a Word 2002 Tool.
[Application.Version] will determine what code is run. Ideally
if Application.Version = 11 then
Compatilitity = 2002
ElseIf Application.Version = 12
Compatilitity = 2003
etc.
Any assistance will be greatly appreciated.
Regards
Mike Tag: how to use dot net(macro) in MS word to create a macr Tag: 97989
regexp question
hi all
it's me again
In my vba program, I've created an new regexp called "reg"
the program will match the first paragraph in the active doc using the
reg.test
the program is how should I write the pattern to match "Chapter X"
I try the pattern "Chapter[ ][0-9]"
but it will also match a line like "Chapter 3342545435342543543543"
how should I tell regexp that it's end line??
I've try another like pattern "Chapter[ ][0-9]\n" , pattern "Chapter[
][0-9]^13"
but they cant match anything
many thanks Tag: how to use dot net(macro) in MS word to create a macr Tag: 97985
Highlight Numbering
In WordPerfect we had the ability to highlight our procedure numbering when
we would make a minor change to it. An example would as follows:
1.0 Procedure 1
1.1 This procedure tells...
The 1.1 could be highlighted in Yellow if there was a minor change to the
text in that step. 1.0 is Heading 1, 1.1 is Heading 2 and so on. Is there a
way to do this in Word? Tag: how to use dot net(macro) in MS word to create a macr Tag: 97977
I want know hot to use dot net(macro) in Microsoft Word to create a macro
using dot net(macro)