Open a web page in Word
Can I use VBA in Word to open a web page on a web server?
I can use followhyperlink to open a HTML file on the local system but if
this is used for a file on a web server it opens the file in a new Browser
window
---
haddress = "file:///" & fname & ".htm"
ActiveDocument.FollowHyperlink haddress
Grateful for any assistance,
Peter E Tag: How may I change the width of the text selector icon Tag: 67479
easy install of template (saveas fileformat:=WDformattempate) ERRO
Hello everyone,
I am working on distributing a VBA utility an want to distribute in the
easest possible way for people to install and use.
I would like to distribute it as a single Word .DOC file that will contain
both the documentation and the VBA. The document will contain buttons to
install the code in the .../WORD/STARTUP folder and also uninstall it. The
utilility will be launched by a toolbar button.
The fall back method (which is working) to distribute it as a .DOC (with
document and Install button) and a seperate .DOT file.
The install code is given below but there is a problem (isn't there always).
1. It will run correctly if I click the RUN button in the VBA editor but if
I click a button in the document I get a "Runtime eror 4198. Cpommand failed"
2. Sometimes, when Word is restarted I get a message saying that the
template in the STARTUP folder is "not valid"
Does anyone have any suggestions on how to get around this problem so I
distribute a single file.
Thanks in anticipation of receiving lots of helpful suggestions,
Peter
http://members.dodo.com.au/bakerevans/
------
Sub install()
Dim destfile As String
Dim sourceFile As String
Dim thisfile As String
Dim theMessage
theMessage = "Do you want to install Word Purge?" & vbCrLf
If MsgBox(theMessage, vbYesNo) = vbYes Then
'name of this file
thisfile = Application.ActiveDocument.FullName
destfile = Options.DefaultFilePath(wdStartupPath) & _
Application.PathSeparator & "Word Purge.dot"
sourceFile = Application.ActiveDocument.Path & _
Application.PathSeparator & "Word Purge.dot"
ActiveDocument.SaveAs FileName:=destfile, _
FileFormat:=wdFormatTemplate
End If
end sub Tag: How may I change the width of the text selector icon Tag: 67478
simple install a template (saveas fileformat:=wdformattemplate) ER
Hello everyone,
I am working on distributing a VBA utility an want to distribute in the
easest possible way for people to install and use.
I would like to distribute it as a single Word .DOC file that will contain
both the documentation and the VBA. The document will contain buttons to
install the code in the .../WORD/STARTUP folder and also uninstall it. The
utilility will be launched by a toolbar button.
The fall back method (which is working) to distribute it as a .DOC (with
document and Install button) and a seperate .DOT file.
The install code is given below but there is a problem (isn't there always).
1. It will run correctly if I click the RUN button in the VBA editor but if
I click a button in the document I get a "Runtime eror 4198. Cpommand failed"
2. Sometimes, when Word is restarted I get a message saying that the
template in the STARTUP folder is "not valid"
Does anyone have any suggestions on how to get around this problem so I
distribute a single file.
Thanks in anticipation of receiving lots of helpful suggestions,
Peter
http://members.dodo.com.au/bakerevans/
------
Sub install()
Dim destfile As String
Dim sourceFile As String
Dim thisfile As String
Dim theMessage
theMessage = "Do you want to install Word Purge?" & vbCrLf
If MsgBox(theMessage, vbYesNo) = vbYes Then
'name of this file
thisfile = Application.ActiveDocument.FullName
destfile = Options.DefaultFilePath(wdStartupPath) & _
Application.PathSeparator & "Word Purge.dot"
sourceFile = Application.ActiveDocument.Path & _
Application.PathSeparator & "Word Purge.dot"
ActiveDocument.SaveAs FileName:=destfile, _
FileFormat:=wdFormatTemplate
End If
end sub Tag: How may I change the width of the text selector icon Tag: 67477
Change Sentence Case
Hi,
I am trying to write a macro that will change the case of all titles to
Sentence case. All titles are paragraphs that are bolded. Below is my code,
but it doesn't work. Any help would be appreciated. Thank you!
Sub TitleToSentCase()
Dim r As Range
Set r = ActiveDocument.Range
With r.Find
.Text = "(^013)"
.Font.Bold = True
.MatchWildcards = True
. Execute
Do While .Found
r.Case = wdTitleSentence
Loop
End With
End Sub Tag: How may I change the width of the text selector icon Tag: 67473
Wildcards
Hi,
Can someone tell me what I am doing wrong here. I am trying to find all
instances of the following in my document:
Appendix 3
Appendix 7.6
Appendix 8.8.9.9.9
etc
I want to find using 1 expression. This is what I am using :
(Appendix)([0-9|.| ]@{1,}) and it works fine but doesn't pick all of them.
For example: I have Appendix 8.1.3, Appendix 8.1.4, Appendix 8.1.5, Appendix
8.1.6 So it picks up the first 2, skips the 3rd one and finds the 4th one...I
don't understand why it does that? Can someone help me.
Thank you in Advance.
~ mehj Tag: How may I change the width of the text selector icon Tag: 67465
autotext and tables
I use a form to insert autotext into a doc. This particular autotext is in
tabular format. My problem is that some of the rows when inserted will span
multiple pages and the next row down will start after. (Which is a good
thing) However some of the rows, when inserted will span multiple pages and
then force a page break before the next row starts.
I hope the above makes sense. Any ideas on how I can force the rows/cells to
stay together? Whether it be some clean-up code or on insertion into the doc.
Thanks,
Dave Tag: How may I change the width of the text selector icon Tag: 67461
Setting VBA Project Password
Here's what I ended up with.
It was a difficult birth.
http://www.standards.com/index.html?SetVBAProjectPassword Tag: How may I change the width of the text selector icon Tag: 67458
How can I create a library for Word VBA?
Hi All,
How can I create a library for Word(97 or later version) VBA?
Is there any web site talk about this?
Thanks
Regards Tag: How may I change the width of the text selector icon Tag: 67456
Word Clipboard Full
My Clipboard is full - 24 items. I cannot clip any more and I cannot delete
any of these. I am an experienced user so don't want the usual suggestions. I
do know my way around Word.
Thanks a lot
Charles Tag: How may I change the width of the text selector icon Tag: 67446
Nested Tables
Helmut/JGM
The other day the three of us where looking at the problem of drilling down
to "deep" nested tables. Cindy Meister "shoved" me twice in the right
direction and I think I have finally put together some code that will delete
"ALL" empty paragraphs in a document. Cindy, if you are reading, thanks
again!! The code is probably inefficient and ugly, but I haven't been able
to break it in over a half hour of trying. The code as part of the complete
Add in is available here in you care to have a look.
http://gregmaxey.mvps.org/Clean_Up_Text.htm
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word. Tag: How may I change the width of the text selector icon Tag: 67441
Disable form field using VBA
Using Word 2002, is there a method to uncheck 'fill-in enabled' using VBA?
For example, on exit of each checkbox in a group, determines if one is
selected and then disables several other fields (so that tab moves to the
next group).
TIA,
Mike Tag: How may I change the width of the text selector icon Tag: 67436
Msbbox - VBok for empty text boxes
Hello,
Created a template with a user form to collect information. Form text and
combo boxes drop information into bookmarks. Everything here works fine.
I have had no success in completing code to get a general message box to
display if any of the text or combo boxes have been left blank when the user
clicks the submit button.
I would like the user to receive the msg. and click OK to return to the from
I am placing my attempt in the cmdSubmit_Click()
Still new to VBA...
--
Thank-you and all suggestions are appreciated. Tag: How may I change the width of the text selector icon Tag: 67429
Inserting a document that will print inside another document
How do I insert a link to another document and have the second document print
as if it was part of the original document Tag: How may I change the width of the text selector icon Tag: 67428
Error 5102
I am opening a new document based on a template from Access. When I move to
the 2nd bookmark, it gives me "Error 5102: You entered multiple destinations
for a page, line, footnote, endnote, or comment." The bookmark is on the
template and I checked spelling, etc. but have no idea what is causing. Can
anyone shed some light on this? Thanks.
David Tag: How may I change the width of the text selector icon Tag: 67427
Get a cell value from excel
Hi,
Firs of all, thank you for reeding my question. I would like to get a cell
value from a excel file into a word file, using macros programming. I mean,
developing a macro able to read a cell.
Thanks Tag: How may I change the width of the text selector icon Tag: 67423
DATES
I have a form in Word which needs to be 2-sided when printed and contain
calendar dates - one for each day - to be filled in by hand by people without
computer access. Preferable format "Friday, April 29, 2005. Can be moved to
Excel. Any help is greatly appreciated. Tag: How may I change the width of the text selector icon Tag: 67418
Copy text to XML element
I open a Word doc based on a template. In
the template I have attached a schema and added some elements to the doc,
one of which is called "FirstName.". What I am trying to do is set the value
of the FirstName element to some text. I have tried several techniques such
as
dim wdApp as New Word.Application
dim wdDoc as New Word.Document
dim wdTemp = "C:\MyTemplate.dot"
dim wdNode as Word.XMLNode
wdDoc = wdApp.Documents.Add(wdTemp)
wdNode = wdDoc.SelectSingleNode("/FirstName")
wdNode.Text = "Nancy"
when I do this, I get error msg 'object reference not set to an instance of
an object" telling me that '/FirstName" is not a valid XPath, I think. I
then try
wdNode = wdDoc.SelectSingleNode("FirstName")
wdNode = "Nancy"
and get the same error.
My question is how can I set the value of an XML element in a doc to a text
value at run time? Thanks for your help Tag: How may I change the width of the text selector icon Tag: 67417
html
Hello,
I have a word document with a lot of html links. How can I download
automatically all the html files of those links?
Bye.
Marcel Tag: How may I change the width of the text selector icon Tag: 67416
hyperlink; read-only
I am trying to find out if it is possible to change the settings of a
hyperlink so that a document will be opened as "Read-only". Thanks! Tag: How may I change the width of the text selector icon Tag: 67414
Opening webpage from vba without opening new IE window
I can open a webpage from vba a couple of different ways:
pAddress = "C:\Program Files\Internet Explorer\IEXPLORE.EXE " & sAddress
Shell pAddress, vbNormalFocus
Shell ("C:\Program Files\Internet Explorer\IEXPLORE.EXE _
www.washingtonpost.com"), vbNormalFocus
But these open a new IE window each time. Is it possible to load a
webpage into an existing IE window, without open a new IE window?
Thanks,
Larry Tag: How may I change the width of the text selector icon Tag: 67411
VBA question, can't get this macro to work
i can't get the replacement text area to work. It finds the right
information, but i can't get the insert section break to work. PLEASE
HELP!!!!
With Selection.Find
.Text = " APR 1-2005 "
.Replacement.Text = Selection.InsertBreak wdSectionBreakNextPage & "
APR 1-2005 "
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With Tag: How may I change the width of the text selector icon Tag: 67410
Storing Child word documents inside Master documents using Word's document objects.
Hi All,
I am trying to store a word(Child) document inside another word document
(Master) in such a way that the Child document can't be seen when the Master
is opened (Master and Child will be inside a single file). By default, when
the document is opened, the Master document is shown. The Child will be
shown when I click my Active X's "show child document" menu item. To achieve
this I tried to store the Child document inside my ActiveX but quickly found
that I can't store more than approx 200KB (I may be wrong in the exact size)
of Child document. I then tried to store the Child document inside Document
variable of Master Doc. The Document variable is hidden so seemed OK. I
broke my Child document in chunks of 100 KB and stored in recognizable
Document variables of Master document Object. So far so good. I tried this
on Windows 2000 Server with Office 2003 and it worked but on Windows XP
after creating 2 such Document variables containing the Child documents it
started giving strange data e.g. If the Child document size is 60 KB whle
storing, on retrieving I get 100 KB!! which then crashes by application
while checking. This is only happening in Windows XP Home Edition and
Professional.
Now questions;
1) Is there any other way to store word document inside a word document
programmatically ?
2) Any reason why is it failing to give me the correct data?
3) On programmaticall removal of the document variables, the size of the
Master document remains the same, why ?
Thanks for reading..
Regards,
Wahaj Tag: How may I change the width of the text selector icon Tag: 67409
AutoExec macro in Word project won't run when Outlook is running
I have an AutoExec macro in a '.dot' project saved in the StartUp folder. It
is supposed to run everytime I run Word. It does, except that if I have
previously started Outlook (with Word selected as Outlooks e-mail editor),
the AutoExec will not automatically run. Why? How can I get the AutoExec
macro to run regardless of Outlooks presence.
Thanks.
Ed Tag: How may I change the width of the text selector icon Tag: 67405
"Getting rid" of tem,plate information
I have a document, based on a certain template. This template is placed on a
server.
When I mail documents based on this template to customers, and they try to
open the document, Word starts searching for the template in the customers.
It takes a long time, and only when Word "are sure" the template is not
there, it opens the document. This is annoying to my customers.
Is there anyway I can remove the connection between document and template,
before mailing the document, maybe using Document_Close() or someting like
that.?
Jan Tag: How may I change the width of the text selector icon Tag: 67403
thezaurus for English Language
How can I get a thezaurus for English Language to use it in Word? I do not
have it, because I use a Polish version of Office Package. Thank you Tag: How may I change the width of the text selector icon Tag: 67402
Deleting text in bookmarks very slow...
Hello,
I've run into a problem in my C# add-in for Word.
One of the operations that the add-in has to do is going over all =
bookmarks in a document and removing the bookmarks and its content if =
certain conditions are true.
Originally, I tried the following:
bookmark.Range.Text =3D "";
Unfortunately, it did not work correctly in all cases (for example, if =
the bookmark spanned table cells).
So I used the following:
Microsoft.Office.Interop.Word.Range range =3D bookmark.Range;
bookmark.Delete();
range.Delete(ref missing, ref missing);
when "missing" was initialized thus:
object missing =3D System.Reflection.Type.Missing;
That works correctly but, according to the profiler, is 4-5 times =
slower!
Since this operation is performed in a tight loop, on a document with a =
lot of bookmarks that need to be deleted, this slowdown is VERY =
noticeable.
The breakdown of the timing between the 3 lines is roughly:
Microsoft.Office.Interop.Word.Range range =3D bookmark.Range; // =
3.6%
bookmark.Delete(); // 13.8%
range.Delete(ref missing, ref missing); // 82.6%
So the culprit is the range.Delete() operation.
I really need to speed this up!
Any help is appreciated.
Thanks,
Alex.
--=20
Address email to user "response" at domain "alexoren" with suffix "com" Tag: How may I change the width of the text selector icon Tag: 67397
How I can change the default font size in normal.dot via VBA
Hi There I need to change the default font from Times New Roman 12 pt to
Times New Roman 11 pt in Normal.dot. I know how do to that manually but I
need to change the font by VBA in a master template and then update all the
users Normal.dots by pushing out the master template. would you please let me
know what I'm doing wrong in below code any help would be appreciated.
Many Thanks,
Leila
Sub AutoExec()
'
'
'
Font
End Sub
--------------------
Sub Font()
With ActiveDocument.AttachedTemplate.Styles("Normal").Font
.Name = "Times New Roman"
.Size = 11
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.Color = wdColorAutomatic
.Engrave = False
.Superscript = False
.Subscript = False
.Scaling = 100
.Kerning = 0
.Animation = wdAnimationNone
End With
'Selection.Style = ActiveDocument.Styles("Normal")
End Sub Tag: How may I change the width of the text selector icon Tag: 67393
hyperlink shortcut file
In Word 2002, I am hyperlinking to the web, our network and to internal
bookmarks. To access our network, I have to set the hyperlink base for the
document to file://c:\ which then messes up the internal links. It was
suggested that I create a shortcut file to link to and the shortcut file than
access the network. Fine but the process has to be seamless to the user. Do
I need VB or VBA to do this? I don't either so this will be a problem. Any
help is greatly appreicated.
Redbird Tag: How may I change the width of the text selector icon Tag: 67392
How do I insert a drop down menu in a document header?
I am creating a template using Word. I need to insert a drop down menu in
the document Header. I can not add a drop down menu to the header. Tag: How may I change the width of the text selector icon Tag: 67387
Square Boxes
I wrote some code in excel that would take cell values and write it to the
appropriate form field in word. I have vbcrlf but when it gets to word i get
two square boxes instead. Does anyone have a work around?
Anthony Tag: How may I change the width of the text selector icon Tag: 67384
number of lines a cell
What method would I use to calculate the number of lines in a cell within a
table programmatically? Tag: How may I change the width of the text selector icon Tag: 67383
Find 2 lines of text, not one
what do i use to find two lines of text. I am searching through a 10,000
page file that is a billing file. the only thing that specifies a change in
bills is two lines. So i haev to find two lines of text, then replace those
two lines with themselves, plus a section break before the two lines. Tag: How may I change the width of the text selector icon Tag: 67382
Document Protection - Editing Restrictions
I set up a fill-form template in Word 2003. When I tried to set editing
restrictions for users to only enter in data fields I set up, the whole
window was "grayed out" so that I couldn't make any selections.
How can I change this to be normal, useable? Tag: How may I change the width of the text selector icon Tag: 67378
Clearing Whitespace after a bookmark
Hello All,
I have a bookmark at the end of template called End. I'd like to be able to
programatically get rid of any extra whitespace or unessary pages after this
bookmark using a macro.
Any suggestions? Any help would be greatly appreciated.
Thanks,
dave Tag: How may I change the width of the text selector icon Tag: 67376
How to increase a text form field size
I am creating a form in Word. The shaded box is small in length. Although
the size is set to unlimited, when the user types something in the box you
cannot see everything the user types.
How can I set the form field properties so if a person wanted to type
something like (like an address), they can see everything they have typed in
the field? Tag: How may I change the width of the text selector icon Tag: 67373
Linking check boxes
I have a form with two lists of checkboxes. Some checkboxes from list A
should automatically choose a particular checkbox from list B. So, for
instance, if any one of checkboxes 1, 3, 5, or 7 is checked, then checkbox 10
should also be checked. Only one of 1, 3, 5, or 7 will be checked at any
one time, all others will be unchecked.
I found the following code in the newsgroups that will work for a making one
checkbox automatically check a second one. (Thanks!) This could work in my
situation, but I would have to use separate macros for each of my checkboxes.
I am wondering if there is a way to put all into one macro.
Sub SetCheckboxes()
ActiveDocument.FormFields("Check2").CheckBox.Value _
= ActiveDocument.FormFields("Check1").CheckBox.Value
End Sub
Thanks for any ideas anyone can give me! Tag: How may I change the width of the text selector icon Tag: 67368
setting ExitMacro (to template)
Okay, get a load of this:
I am trying to check code using an attached template, and after I perfect
the code, make the attached template a workgroup template. I hope that's
proper.
So, I name the template "Forms.dot" and make it an attached template. (When
"Forms.dot" is my "Normal.dot", the code works perfectly.)
Now, as an attached template (with a blank Normal.dot), the code errors out
at the following code:
ActiveDocument.FormFields(4).ExitMacro = "doCopies"
"doCopies" is a sub within the attached template "Forms.dot", which is where
the code errors. I shouldn't have to refer to the module or project if it's
in the same routine, should I? When I halt the code, and manually go to the
document, I can manually "see" the sub "doCopies", so it's available, but
still my code errors.
Anyway, I can't get past this. Can anyone offer some help?
TIA Tag: How may I change the width of the text selector icon Tag: 67363
How do I eliminate auto text when I open word?
I need assistance. When I open a Word document, there is text already
printed along with a font size. Tag: How may I change the width of the text selector icon Tag: 67358
setting XML elements in Word doc to text
Hi,
From VSTO in Visual Studio.NET, I open a Word doc based on a template. In
the template I have attached a schema and added some elements to the doc,
one of which is called "FirstName.". What I am trying to do is set the value
of the FirstName element to some text. I have tried several techniques such
as
dim wdApp as New Word.Application
dim wdDoc as New Word.Document
dim wdTemp = "C:\MyTemplate.dot"
dim wdNode as Word.XMLNode
wdDoc = wdApp.Documents.Add(wdTemp)
wdNode = wdDoc.SelectSingleNode("/FirstName")
wdNode.Text = "Nancy"
when I do this, I get error msg 'object reference not set to an instance of
an object" telling me that '/FirstName" is not a valid XPath, I think. I
then try
wdNode = wdDoc.SelectSingleNode("FirstName")
wdNode = "Nancy"
and get the same error.
My question is how can I set the value of an XML element in a doc to a text
value at run time? Thanks for your help. Tag: How may I change the width of the text selector icon Tag: 67357
setting XML elements in Word doc to text
Hi,
From VSTO in Visual Studio.NET, I open a Word doc based on a template. In
the template I have attached a schema and added some elements to the doc,
one of which is called "FirstName.". What I am trying to do is set the value
of the FirstName element to some text. I have tried several techniques such
as
dim wdApp as New Word.Application
dim wdDoc as New Word.Document
dim wdTemp = "C:\MyTemplate.dot"
dim wdNode as Word.XMLNode
wdDoc = wdApp.Documents.Add(wdTemp)
wdNode = wdDoc.SelectSingleNode("/FirstName")
wdNode.Text = "Nancy"
when I do this, I get error msg 'object reference not set to an instance of
an object" telling me that '/FirstName" is not a valid XPath, I think. I
then try
wdNode = wdDoc.SelectSingleNode("FirstName")
wdNode = "Nancy"
and get the same error.
My question is how can I set the value of an XML element in a doc to a text
value at run time? Thanks for your help. Tag: How may I change the width of the text selector icon Tag: 67356
setting XML elements in Word doc to text
Hi,
From VSTO in Visual Studio.NET, I open a Word doc based on a template. In
the template I have attached a schema and added some elements to the doc,
one of which is called "FirstName.". What I am trying to do is set the value
of the FirstName element to some text. I have tried several techniques such
as
dim wdApp as New Word.Application
dim wdDoc as New Word.Document
dim wdTemp = "C:\MyTemplate.dot"
dim wdNode as Word.XMLNode
wdDoc = wdApp.Documents.Add(wdTemp)
wdNode = wdDoc.SelectSingleNode("/FirstName")
wdNode.Text = "Nancy"
when I do this, I get error msg 'object reference not set to an instance of
an object" telling me that '/FirstName" is not a valid XPath, I think. I
then try
wdNode = wdDoc.SelectSingleNode("FirstName")
wdNode = "Nancy"
and get the same error.
My question is how can I set the value of an XML element in a doc to a text
value at run time? Thanks for your help. Tag: How may I change the width of the text selector icon Tag: 67355
Any way to have Dialog(wdDialogEditReplace) function like interactive Replace Dialog
Folks,
I want to have the Replace dialog displayed with parameters drawn from a
text file in which the lines have the format "Findstring=ReplaceString".
E.g., an entry of "1=2" would populate the find field of the dialog with "1"
and the replace field with "2". The code below more or less works except
that after the user selects "Replace All", the usual prompt indicating that
"X replacements have been made" or "Word has finished searching the
document" does not appear. Thus, it will be a bit disorienting when using
the routine. Am I missing some properties that enable/disable the messages?
Thanks,
Tom
Sub testreadfile()
Dim AStr() As String
Dim SearchStr As String
Dim RplcStr As String
Dim FString As String
Dim DlgFind As Dialog
Dim AString As String
On Error Resume Next
Set DlgFind = Dialogs(wdDialogEditReplace)
FString = "C:\wordmacros\a.txt"
Open FString For Input Access Read As #1
While Not EOF(1)
Line Input #1, AString
If Len(AString) > 0 And Not AString Like "*[=]*" Then
MsgBox AString + " is not a valid entry"
End If
AStr = Split(AString, "=")
SearchStr = Trim(AStr(0))
RplcStr = (AStr(1))
With DlgFind
.Find = SearchStr
.Replace = RplcStr
.Show
End With
Wend
Close #1
End Sub Tag: How may I change the width of the text selector icon Tag: 67354
embed macro on photo to place in Word 2000 document
Can this be done? I have a user that does not want to press F9 to recalculate
a field in an unprotected form. I cannot protect the form either. Thanks! Tag: How may I change the width of the text selector icon Tag: 67350
Code for Insert Section Break, Please Look If you Know VBA
I am trying to insert a section break before a certain piece of text. I
need to be able to print the first page of a bill to one tray, and the rest
to another tray. I have been told taht is accomplished by page/section
breaks in different points. Here is the code that i am having the problem
with:
I haven't been able to get it totally working. Here is the code i am using.
I can't seem to get the section break to work before i replace the data. the
line wiht the astrixes is the line giving me trouble
With Selection.Find
.Text = "
________________________________________________________________________________________________" & "^l" & " APR 1 - 2005 "
******* .Replacement.Text = Selection.InsertBreak & "^&"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.Execute Replace:=wdReplaceAl Tag: How may I change the width of the text selector icon Tag: 67349
Protect section of document
Some advise on how to achieve the following would be appreciated please.
Using Access 2002 and Word 2002 we are using vba code to automate a merge
between access to a word.
On the access fields are bookmarked in the word doc & merge is working fine.
The concern is that a user would open the word document and delete or edit
the bookmarks
What is the best way to protect the document
TIA
Tom Tag: How may I change the width of the text selector icon Tag: 67340
Closing activedocument
Hi,
We have been using a template for a couple of years without trouble in Word
2000. We've recently upgraded to Word 2003 and the code now produces an
error. The template opens a form which has buttons to execute a mail merge
with some Outlook contacts. It saves the document with a temporary name to
merge the data and print it and then closes the temporary document to go on
to the next person. It uses the lines:
ActiveDocument.PrintOut
ActiveDocument.ActiveWindow.Close SaveChanges:=wdDoNotSaveChanges
Now when it encounters the last line it gives the following error:
You cannot close MS Office Word because a dialog box is open. Click OK,
switch to Word, and then close the dialog box.
It seems to not like the dialog box from the original document being open
when I close the temporary document. Out of interest I opened the same
document on a laptop with Office 2000 and it worked fine again.
Any suggestions please?
John Tag: How may I change the width of the text selector icon Tag: 67336
Delete Certain Lines with Macro
I am taking various txt files and editing them so they will work with
different database programs. The data is coma delimitted. At the end of some
files there may or may not be several blank lines. I need code to delete line
if blank. (I can replace blanks with a word if that makes it any easier)
Thanks in advance for your help. Tag: How may I change the width of the text selector icon Tag: 67334
Drop down_drop down list
I have developed a word 2000 form template which is protected. The user
fills in the blanks. There is a header (but not in the header) that I want
to be able to drop in one of several 2-line addresses. Dropdown has one line
limitation, can dropdown list "break" a line to create the address lines?
Autotext field works, but leaves problems with the "unprotected" sections it
resides in...have run out of ideas. Is there a simple way to give the user
the ability to choose one of two addresses? Best regards Tag: How may I change the width of the text selector icon Tag: 67332
word needs a 'table of hyperlinks' display text, address, page#
this would be useful for managing all the hyperlinks in a document and would
work like a table of contents. It would basically report on display text,
adderss, and page number and by default be sorted by address and page number.
----------------
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=1366a012-32ef-4ce6-a0d0-321b6bdd914e&dg=microsoft.public.word.vba.general Tag: How may I change the width of the text selector icon Tag: 67331
Word Forms: text field as number
I define a text field into a form as "number" but when filling the form Word
lets me enter letters into the field.
How can I avoid that?.
Carlos. Tag: How may I change the width of the text selector icon Tag: 67325