Changing Paragarphs in a Range
I am interested in defining a range of paragraphs in the main story of a
document based upon a selection and then chaging the first few characters in
each paragraph in that range. When I try to update a paragraph using a "for
each" loop the range is redefined apparently due to the change and I canonot
effect a change in more than one selected paragraph. Tag: autotextlist field control Tag: 59013
FileSearch Object not working
I have a macro which uses a Shell FTP to retrieve a file from UNIX to Windows
to be used as a data source for a mail merge (just acomma deleimited test
file). At one site which is running Windows XP and Word 2002 I'm having
problems with the FileSearch object not finding the file after the successful
Transfer of the file.
First the user was getting a runtime error #70 Permission Denied and after
checking with the site's IT dept. and being assured that the user has Full
rights to the network directories where the action is taking place, the error
continued. I then commented out a KILL command which got rid of the
premissions error (it deletes the script I created to be used in the FTP),
but after that the macro does a file search to be sure that the file is
really there and it always fails, even though I can see the file in the
directory.
The code is:
'***** Delete file with userinformation
Kill (DownloadPath & "Ftpget.txt")
'***** Check if file is present after download
Set objFSO = Application.FileSearch
With objFSO
.LookIn = DownloadPath '***Path to where file is
.FileName = FileToGet '**Name of file
.MatchTextExactly = True
If Not .Execute > 0 Then
'***** File doesn't exists, display error message!
ElseIf FileLen(DownloadPath & FileToGet) < 10 Then
'***** File does infact exists, now check if it is more then 0 bytes =)
error message2
Else
'***** File download succesfull
End If
End With
Set objFSO = Nothing
The user always recieves the first error message. I've check the references
and they are all the same. This code works at other sites. Is there
something that was not installed on this user's machine? Can anybody help?
I'm out of ideas.
Thanks,
Steve Tag: autotextlist field control Tag: 59005
HT mine data from Word to SQL Server
I need to be able to somehow mark parts of an existing
Word document, pull the marked data from the document and
map it into a table in SQL. I have seen information on
how to do it from Excel, but not for Word. Can you point
me in the right direction? Tag: autotextlist field control Tag: 58996
Changing numbers
** This is a re-posting of the question asked on word.vba.beginners on 9
November. I'm reposting it here due to a paucity of responses to my first
post! **
We sometimes get documents where paragraph numbering needs changing
and for one reason or another we cannot use automatic paragraph
numbering in the document, just manual numbering. I am trying to
write a macro that will enable you to renumber basic paragraphs in a
document (nothing fancy, just ones numbered 1, 2, 3, 4 etc).
I am using the Selection.Find method to search for the first number,
then I want to replace it with another (incremented) number, search
for the next number, replace that, and so on till the end of the
document. I cannot get this to work. If finds the first number and
replaces it but then stops. Here's the code I've got so far, and I
daresay I'm going about it the wrong way.
Sub ReplaceNos()
Dim a As Integer
Number = 1
Selection.Find.ClearFormatting
With Selection.Find
.Text = Number
.Forward = True
.Wrap = wdStop
.Format = False
Do While .Execute
if Selection.Information(wdHorizontalPositionRelativeToTextBoundary)/72<2
then
Number = Number + 1
a = Selection.Text
a = a + 5
Selection.Text = a
Selection.Collapse Direction:=wdCollapseEnd
End if
Loop
End With
End Sub
This *should* search for the digit 1 and, if it is within the first 2
inches of the left margin, replace it with 6. Then search for "2",
replace it with 7, etc etc.
Silly question... why does it not work? I really need a lot more
knowledge of how the selection.find method works, I think!
Steve Wylie Tag: autotextlist field control Tag: 58994
Word templates over a WAN
I have a client that has an interesting problem.
The IT department wants control over templates that are installed on their
corporate intranet. The network is broken up into several LANs operating at
100Mbs that are interconnected using a WAN at 7Mbs. They also have users
that connect to the intranet using either dialup/broadband using a VPN. All
templates are stored on their central server and they have the path to the
templates set for each individual user using the Workgroup templates.
A user that creates/uses a document that uses the template from the LAN
experiences a 2 to 3 second delay. This user A saves the document and sends
to user B that is on a different segment of the WAN. When user B opens the
document then the open will take 20 to 30 seconds to complete. Each of the
templates is running some VBA. Some users experience wait times of upto 20
minutes when opening a document.
My guess is that when the document is opened by user B it is trying to
reference the template that is on user A's segment of the WAN.
I have the following recommendations for the client:
1) Replicate the servers for each of the segments such that the template is
resolved to the local LAN.
2) Deploy the templates to each and every client machine on their network.
Provide an installer that each user will use to install on each individual
system.
Any thoughts or comments? Tag: autotextlist field control Tag: 58993
error when changing a paragraph style
My document has a paragraph style named "myData." When I select one
paragraph and run this subroutine:
For Each para In Selection.Paragraphs
para.Style = myData
Next para
I get the following error message:
"One of the values passed to this method or property is out of range,"
and the line:
para.Style = myData
is highlighted.
What am I doing wrong? Tag: autotextlist field control Tag: 58992
Using outlook contact details
CAN I USE CONTACT INFORMATION IN OUTLOOK CONTACTS TO WRITE LETTERS OR A FAX
IN WORD? Tag: autotextlist field control Tag: 58990
Finding Boot Drive
Is there a function for finding the boot drive from within VBA that
will work will with Word '97 and later for Windows '98 or later?
I have an installer that installs an INI file in the Windows directory
on the user's system, which may or may not be on the C: drive. When my
template opens, I need to read that INI file, but I'm not sure how to
know the drive to use.
Thanks in advance,
gary Tag: autotextlist field control Tag: 58989
Determine if cursor on a graphic
Does anyone know how to programmically determine if the
cursor/current selection resides on ANY type of graphic?
Thanks a bunch. Tag: autotextlist field control Tag: 58988
Tracked changes and outline levels
In code, how do I read a tracked change in Word and know the outline level?
I want the code to find a tracked change, read it, record the outline
number/level, and write a summary of the change.
For example, if paragraph 3.1 of a document had a tracked change that showed
the word "contract" was replaced with "purchase order", I want the code to
write the following: "In paragraph 3.1, replace 'contract' with 'purchase
order'." Tag: autotextlist field control Tag: 58979
Switching Between Printers in a Single Macro
Hello,
I am in a fix. I have a macro that basically needs to perform the following
tasks:
Save a mail merge document to an RTF with a specific name. (So far so good
on this one!)
Print the RTF to a PDF file.
Print the RTF to the printer on LPT1.
Delete the RTF.
Close any remaining open windows.
Most of the macro is working fine. My trouble is switching between the two
printers. No matter what I do, the default printer is being changed to Adobe
PDF. I either need to know how to prevent this or how to switch it back to
the printer on LPT1.
The template, which incorporates this macro, is being distributed to several
different people each with different printers and printer names.
Is there a way to accomplish what I need????
Here is my macro so far ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub OSDFileSaveAsRTF()
'
' OSDFileSaveAsRTF Macro
' Save merged file as an RTF file
'
With ActiveDocument.Bookmarks
strFileName = .Item("OSDNumber").Range.Text
strFileName = strFileName & .Item("BasicForm").Range.Text
End With
ActiveDocument.SaveAs FileName:="c:\osd\" & strFileName & ".rtf", _
fileformat:=wdFormatRTF
'Print saved RTF File to PDF File
With Dialogs(wdDialogFilePrintSetup)
.Printer = "Adobe PDF"
.DoNotSetAsSysDefault = True
.Execute
End With
'ActivePrinter = "Adobe PDF"
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, PrintToFile:=False,
PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
'Set active printer back to printer on LPT1
'ActivePrinter = " on LPT1:"
'Delete RTF File
'ActiveDocument.Close
'Kill "c:\osd\" & strFileName & ".rtf"
'Close remaining active documents
'ActiveDocument.Close savechanges:=wdDoNotSaveChanges
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any help would be greatly appreciated.
Thanks in advance for your assistance.
Regards,
Gilley
aka DilbertIsMyHero Tag: autotextlist field control Tag: 58978
Switching Printers within the same Macro
I have searched and searched for a solution to my problem. I have found bits
and pieces but nothing to tie it all together.
I have a macro which basically does the following:
Saves a merge document to an RTF file.
Prints the saved RTF file to a PDF file.
Prints the saved RTF file to the printer on LPT1.
Closes the active window.
Deletes the RTF file.
Closes remaining open windows.
The problem lies in switching between the Adobe printer and the printer on
LPT1. This template, which contains the macro, will be distributed on
several different computers. Each computer has its own printer with its own
name.
I am saving to the RTF file so that the PDF file is forced to have the same
name in a specific directory.
Below is my macro (such as it is right now)!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub OSDFileSaveAsRTF()
'
' OSDFileSaveAsRTF Macro
' Save merged file as an RTF file
'
With ActiveDocument.Bookmarks
strFileName = .Item("OSDNumber").Range.Text
strFileName = strFileName & .Item("BasicForm").Range.Text
End With
ActiveDocument.SaveAs FileName:="c:\osd\" & strFileName & ".rtf", _
fileformat:=wdFormatRTF
'Print saved RTF File to PDF File
With Dialogs(wdDialogFilePrintSetup)
.Printer = "Adobe PDF"
.DoNotSetAsSysDefault = True
.Execute
End With
'ActivePrinter = "Adobe PDF"
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, PrintToFile:=False,
PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
'Delete RTF File
ActiveDocument.Close
Kill "c:\osd\" & strFileName & ".rtf"
'Close remaining active documents
ActiveDocument.Close savechanges:=wdDoNotSaveChanges
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I hope you can make heads or tails from the above since the line breaks are
messed up.
I basically want to make sure at the end of the process that the default
printer is the printer on LPT1 not Adobe PDF. No matter what I do, the
default printer keeps getting switched over.
Any help would be appreciated. And thanks in advance.
Regards,
Gilley
aka DilbertIsMyHero Tag: autotextlist field control Tag: 58976
How to hide the Auto* for user use ?
[Posted to microsoft.public.word.vba.general and copy sent to the cited author]
Hi,
How to hide the AutoOpen, AutoNew and AutoClose macros from the list
which appears when uqser go to Tools/Macro/Macros.
Knowing, I don't wish to lock access to this list (ie. remove the Macro
command in menu) nor erase these subs in the code by itself (since I
just want to stop the user calls but not the internal ones).
Any idea ? Tag: autotextlist field control Tag: 58973
Finding Bookmarks in Headers
I need to be able to goto a bookmark in a header and I use several different
headers in the same document by using section breaks. I have not determined
how to do this since the headers are not visible in the goto list. I am
using word 2002 sp3 Tag: autotextlist field control Tag: 58968
Template Codes/Signature
I'm not sure this is the correct forum, but our department has 10-12
templates that we all use. Up to now, we've been maintaining our own copies
in our Office Template folder, but would prefer to keep one authoritative
copy in our departmental folder, and configure each user's Word to look in
that folder also.
We can insert a Field code to insert the username, but we'd like to insert a
scanned signature also, tied to the user.
Does anyone know how to do this?
Thanks for all help.
Sprinks Tag: autotextlist field control Tag: 58966
Extending match time for a combo box
Hi all,
I have an application (a Word 2002 VBA macro) that requires users to make a
selection from a combo box. The users typically type text to make the match,
but the 2-second default timing for the combo box isn't enough. They're
complaining that they'd like more time to type.
I can't find any properties on the ComboBox to change this. I did find this
text in the Help documenting the time allowed for matching:
"The matching feature resets after two seconds (six seconds if you are using
Far East settings). For example, if you have a list of the 50 states and you
type "CO" quickly, you will find "Colorado." But if you type "CO" slowly,
you will find "Ohio" because the auto-complete search resets between
letters."
Has anyone figured out a way to change this behavior so it takes longer than
2 seconds to reset?
Thanks,
Doug Tag: autotextlist field control Tag: 58963
eliminating corruption from pasted in text
Many style, bullet, and numbering problems seem to start when text is pasted
in from another Word document. Can someone suggest a way to use VBA to get
text from another document without causing corruption?
Thanks,
Keith Tag: autotextlist field control Tag: 58960
custom menu items linked to 'remote' macro
I'd like to add a custom menu item (easy enough), but want the macro to point
to macro located in a file on the network. The reason for this is so that
many users will use this macro and I dont want to have to maintain each
user's normal.dot file.
I want a single source for the macro, so that users can benefit from
updates/bug fixes/revs etc without having to copy the code each time there's
a revision. It seems the problem is that the only macros that show up as
available for menu items are located in the normal.dot file (stored locally).
I program Excel quite a bit, and it's easy enough to link a menu item to a
networked spreadsheet. But it seems this option is not available to Word? If
not, are there any elegant solutions/workarounds? Tag: autotextlist field control Tag: 58953
shift tabs for a selected paragraph?
I need to shift all of the tabstops for a selected paragraph to the right by
a given amount, say 0.2 inches. So far all of my approaches meet with error
messages or unexpected results. Can someone suggest a way of accomplishing
this?
Thanks,
Keith Tag: autotextlist field control Tag: 58952
VBA to remove toolbar and menu choices
How can I use VBA to remove toolbar and menu choices for a particular
document?
Thanks,
Keith Tag: autotextlist field control Tag: 58949
Intercept a toolbar or menu function call?
In Word Office 2003 with SP1, is there a way to intercept the function call
to a menu item or toolbar button, so that it uses custom functionality in
place of the standard Word functionality?
Thanks,
Keith Tag: autotextlist field control Tag: 58948
Fill Word table from external data source?
I have a series of Word documents that display detail about a single topic.
For one of those pieces of detail, an Access database contains the detail for
all topics (simple table that includes a column for topic name). This allows
us to view all the detail for a specific topic in one place, but also allows
us to view all the info for a specific detail data item across topics.
I don't want to update both places when a change is made. Is it possible to
keep the data in the Access database, then dynamically fill a table in each
Word doc with the detail for its specific topic when the Word doc is opened? Tag: autotextlist field control Tag: 58946
Find "Previous" or "Backwards"
Word 2003. Windows XP
The Word find dialog only has "Find Next". There doesn't seem to be
any way to "Find Prvious" or whatever command to search/find backwards
through the document.
Is there any way to do this with some VBA code? It should be hooked
to the current Find process. I.E. One Keyboard shortcut would "find
next" and another would "find previous."
I'm looking for a way to go directly back to the prior hit, or second
prior hit, but then proceed forward again. A locked loop to go
through the entired document in the bacwards direction only isn't
really helpful.
Thanks for any help.
Fred Holmes Tag: autotextlist field control Tag: 58942
Macro Button Appearanc
Does anyone know how to show a macro button as used?
Let me explain - word standard bold button, if your cursor is in text that
is bold the button appearance is depressed or it looks activated. when the
text is not bold the button appears normal.
I would like to add that functionality to a template I am working on,
however I have been unable to find any documentation on how to achieve this. Tag: autotextlist field control Tag: 58940
Changing the selection position
Hi all
I woder whether there is any way of changing the position of the selection
to another position e.g. a cell in a table
or just Go to end of document, beginning of document etc.
Thank you in advance
Shmuel Tag: autotextlist field control Tag: 58931
Can I associate a smart tag with an custom object?
Hi
I want to associate a smart tag with a custom object within Word, Excel,
Powerpoint. The objects can be a table, chart or text that have special
properties which enable its contents to be remotely updated from a web server
(via SOAP/XML interface). I want to associate a smart tag with these object
types to enable users to perform certain actions on the object, such as
"refreshing" the table, chart, text from the remote web server.
After reading all about Smart Tags, I am sure this is possible, though
possibly Smart tags are not the best solution. If I use Smart tags, I would
not need to code a recogniser, as the object would only need to be associated
with a smart tag and its actions upon creation. I was thinking that perhaps a
better way to do this would be to provide a context-sensitive pop-up menu for
each object and enable the user actions through this menu.
Does anyone have any advice on this topic?
Regards
M
--
Mark McGillion PhD Tag: autotextlist field control Tag: 58925
Hidden help text
I am trying to create a document that has certain words in it that when you
move the cursor over the word a bubble will appear with text, such as a help
or other terms that can be used in place of what is on the form. I want to be
able to edit this information. Is there any way to do this? Tag: autotextlist field control Tag: 58922
Removal of templates
Is it possible to remove (uninstall) advertised templates (templates that was
installed with Office, like: "Elegant fax", "Elegant Letter", etc... ) from
computer using VBA?
I would like to remove them from "templates" dialog ("File"->"New...").
I know that it can be done through Office setup application, but how to
automate this because I have to do it on 200+ computers in our network. Tag: autotextlist field control Tag: 58921
how to send mail via default mail application?
I need to send my document via default mail application.
What i must use to do this?
Maybe some sugestions about writing and sended it? Tag: autotextlist field control Tag: 58920
Using VBA via ActiveX?
Are there any issues to be aware of in running VBA via ActiveX controls,
and creating docs from webpages etc.
---
Message posted from http://www.ExcelForum.com/ Tag: autotextlist field control Tag: 58917
Help with printing on specific paper size
Hi.
I want to print a document (an invitation) to a specific paper size (4.7 in
x 6.5 in.), but for some reason the document keeps printing in the middle of
the page and some words are cut off. Any suggestions?
Thank you. Tag: autotextlist field control Tag: 58915
Working with a created instance of xl
wd2k/off2kPro
What I want to do is (from a Word Macro) create an instance or use an
existing instance, of Excel and copy a range of cells.
I figured I'd want this in case the user already had Excel running (I
didn't want to shut them down).
This was made necessary because I can't use the InsertFile function in
Off 2003 so I thought I'd use the "PasteFromExcel" function.
Sometimes it would work, other times it wouldn't so I decided to do some
learning at home (hence my testing is in Off 2k).
This is the 1st time I've delved into this so I'm way over my head here
(a little bit of knowledge is a dangerous thing!).
Here is my test macro (I've added comments with *'s);
Note that it locates/opens the Wb and sheet ok (so I've deleted some
logic for "readability").
Sub GetThePSTable()
Dim XLap As Excel.Application
Dim XLwb As Excel.Workbook
Dim XLSht As Excel.Worksheet
Dim XLPSnm As String
xx = ""
On Error Resume Next
Set XLap = GetObject(, "Excel.Application")
If XLap Is Nothing Then
Set XLap = New Excel.Application
xx = "Using New Object"
Else
xx = "Using Existing Object"
End If
XLap.Visible = True
Set XLwb = XLap.Workbooks.Open(PSDir & PSName)
Set XLSht = XLwb.Worksheets(XLPSnm)
XLSht.Activate
lro = 0
XLSht.Range("a65536").Select
XLap.ActiveCell.End(xlUp).Select
lro = XLap.ActiveCell.Row *******Works OK to
here********
*** The following three statements are what I've been testing (by
uncommenting one at a time)
'XLSht.Cells(3, 1) = "This is inserted" ** This works
'XLSht.Range(Cells(1, 1), Cells(lro, 4)).Select ** This will work
"once in a while"
'XLSht.Range(Cells(1, 1), Cells(lro, 4)).Copy ** This doesn't work
(doesn't copy to the clipboard)
Set rngSect = Ad.Sections(1).Range.Paragraphs(3).Range **N/A to
problem - I set breakpoint here
rngSect.Select
'Selection.PasteExcelTable False, False, True '** Not applicable
to 2k**
XLap.DisplayAlerts = True
XLwb.Close
If xx = "Using New Object" Then
XLap.Quit
Set XLap = Nothing
End If
Set XLwb = Nothing
Set XLSht = Nothing
End Sub
In addition - At the breakpoint I'll get "<Remote server machine does
not exist or is unavailable>"
as a hover message on the "XLSht.range.......Select"
It's right, "the remote server does not exist" - this machines sitting
all alone.
What started as an interesting educational exercise and had turned into
a nightmare as the results are unpredictable.
Can anyone give me hints?
--
Regards;
Rob
------------------------------------------------------------------------ Tag: autotextlist field control Tag: 58914
How to retrieve the content of a page
I am looking for a way to retrieve the text content of a page. I didn't seem
to find an easy way to do this in vba. Any ideas? Tag: autotextlist field control Tag: 58906
Update all fields on saving/closing
Hey, would anyone be able to pass on the code for updating all fields in a
template when the user closes and/or saves and closes?
Here is what I have so far:
ActiveDocument.Fields.Update
TIA,
Jason Tag: autotextlist field control Tag: 58903
Saving Word documents in temp files
I am working on an MS Word add-in written in C# using IDTExtensibility2.
I would like to save a copy of the ActiveDocument at certain times. I would
like for this saving to be similar to Word's auto-recover saving where it is
completely transparent to the user. This means that when a new document is
saved by my code the filename does not appear in the title bar and the user
is prompted to save changes to a new file (not the one I saved to). Also,
when my code saves from an existing document, the user is still prompted to
save their changes.
I tried to save using Document.SaveAs(), but it is just as if the user saves
the document. Is there another function that can do this save for me?
One other idea I've had is to make a copy of the Document object, and then
save that Document to a file. I've not found any way to copy the Document,
other than the shallow object.MemberwiseClone.
Thanks for the help.
David Tag: autotextlist field control Tag: 58902
Printout - Word closes before printing starts
I have a VB app running on Citrix. I'm using the PrintOut command when a user
goes to print a document. In this case, I have a 14 page document. When I
run the app from my desktop, it prints out ok. When I run the app via Citrix,
because the code is running so fast, it appears the document is trying to
spool, but because I immediately close Word, the document never gets a chance
to get to the printer.
Is there a way for me to tell via code if the document is still printing
from Word?
I've thought of using a timer event but tha's unpredictable because of
different sizes of documents. Tag: autotextlist field control Tag: 58901
InUse Property of Styles: What exactly does it mean
We have been working with a vendor on an issue where a numbering tool
utility of theirs essentially takes a document and analyzes all of the
styles to determine if they are part of an outline numbering scheme.
The problem is that whatever they are using to determine if the style
is part of a scheme iis changing the InUse property of each style in
the document to TRUE. This means that when users work in the document,
all styles in the document become "available styles" or InUse.
So I have a couple of questions. I've tried writing code that will
capture which styles were InUse before their utility is run. This
routine stores each style whose InUse status is set to True into an
array.
<<<<
Public Sub InUseStyles()
Dim n As Integer, x As Integer, y As Integer
Dim TemplateName As String
Dim StylesInUse() As Variant
Dim StyleName As Variant
Dim Styles As Styles
Set Styles = ActiveDocument.Styles
ReDim StylesInUse(0)
For n = 1 To Styles.Count
If Styles(n).InUse = True Then
ReDim Preserve StylesInUse(UBound(StylesInUse) + 1)
StylesInUse(UBound(StylesInUse)) = Styles(n).NameLocal
End If
Next n
End Sub
>>>>>
This procedure works very well in collecting those styles InUse.
But then I want to call their utility (which works fine) and then
reset only those styles that were InUse before I ran their utility.
Here is what I'm doing,
<<<<<
'Now we reset the InUse property back to it's original state
'This first part sets the InUse property of all styles back to false.
Perhaps extraneous...
For x = 1 To ActiveDocument.Styles.Count
ActiveDocument.Styles(x).InUse = False
Next
'This section restores the original InUse styles to True
For y = 1 To UBound(StylesInUse)
Styles(StylesInUse(y)).InUse = True
Next
>>>>>>
But I keep getting a "Can't assign to read-only property" of the
section where I set each style to False. I assume it has to do with
not being able to delete Normal or Heading 1, etc... but I'm not sure.
Can anyone tell me if what I am trying to do can be done? I would
prefer if they would just tell us what they are doing to set each
style to InUse but they won't! I just don't think I understand the
InUse property as well as I could. But the vendor doesn't either!
Thanks,
Bill Tag: autotextlist field control Tag: 58900
Search for a word in a document except for tables?
How do you search the whole document, excluding tables, for a certain word?
And vice versa (just search tables)?
Thanks. Tag: autotextlist field control Tag: 58896
VBA files collection problem
I want to get hold of a particular file which is a member of a files
colleciton of a given folder .
IN the following code , i'm in trouble on the line :
Set fil = files(lngC)
Why don't this work ??
Thanks
Chris
******************************************************
Sub EraseFirstCharsFromFileNames()
Dim fldr As Folder
Dim files As files
Dim fil As File
Dim lngFileCount As Long
Dim lngC As Long
Set fldr = mfso.GetFolder("F:\000 Samples\String Textures Time&Space
Creative EssentialsSeries\03 Cello Tremolando")
lngFileCount = fldr.files.Count
For lngC = 1 To lngFileCount
Set files = fldr.files
Set fil = files(lngC)
' mess with the file name here
Next
Set mfso = Nothing
End Sub
************************************************************ Tag: autotextlist field control Tag: 58895
i can't get my program to open or stay open?
I have MS Office 2000 Premium. I create the Word shortcut on my desktop,
double click, it opens then shuts down again. I can't even open a document
anymore. Any suggestions?? Tag: autotextlist field control Tag: 58891
Word and HTML
I am working with a developer on a program that creates quotations in Word.
The many pieces of text have to be entered into the program in HTML. The
books we have on HTML all talk about displaying the results on Web pages.
Does anyone know of a source that has specific information on how the HTML
code will work going into Word? We are not sure when the HTML will control
the style and when Word will control it.
Thanks!
Mary Lee Tag: autotextlist field control Tag: 58886
Lock Header Problem
Earlier in the summer someone very kindly provided me with this link
http://word.mvps.org/faqs/customization/ProtectWord2000PlusHeader.htm to
keep my users out of the headers. Well ... one of my users found a way in.
He searched for the text in the header and bypassed the "security" code.
HELP!! How can I prevent this unauthorized access? Tag: autotextlist field control Tag: 58885
Assessment
Hi,
The other day a person asked how to find and underline text that was quoted
in a document without also underlining the quotation marks. I offered a
double pass find and replace solution which works, but I became curious as
how to do it with a macro. I am a VBA novice and rusty now from lack of us.
I put together the following code which seems to work, but I had difficulties
resolving how to find each occurence of text without creating a circular
loop. If I used .Wrap wdFindContinous, it would get in a never ending loop.
If I used .Wrap FindStop, then I only found the first occurrence. I recalled
from earlier experience that I could use a .Collaspe wdCollaspeEnd to force
the search to continue until reaching the end of the document. I think that
there should be a better way, but stuck with what I have. Any insight
appreciated.
Sub FindAndUnderlineTextInQuotes()
'Underlines text exclusive of the quotes marks
Set oRng = ActiveDocument.Content
With oRng.Find
.ClearFormatting
.Text = """<*>"""
.Forward = True
.Wrap = wdFindStop
.MatchWildcards = True
Do While .Execute
If oRng.Find.Found = True Then
With oRng
.MoveEnd Unit:=wdCharacter, Count:=-1
.MoveStart Unit:=wdCharacter, Count:=1
.Font.Underline = True
.Collapse wdCollapseEnd
End With
End If
Loop
End With
End Sub Tag: autotextlist field control Tag: 58884
The parsed text stream tags of a word 8 file
Hi folks,
the parsed text stream of a word 8 file (besides a few entries from us for
better understanding) can contain the following:
Paragraph:Range [type=PARAGRAPH],
inTable=false
CharacterRun:Range [type=CHARACTER]
SPECIAL[{DRAWNOBJ}]
end CharacterRun:
CharacterRun:Range [type=CHARACTER]
SPECIAL[{FLDBEGIN}]
end CharacterRun:
CharacterRun:Range [type=CHARACTER]
[ ]
end CharacterRun:
CharacterRun:Range [type=CHARACTER]
[SHAPE \* MERGEFORMAT]
end CharacterRun:
CharacterRun:Range [type=CHARACTER]
[ ]
end CharacterRun:
CharacterRun:Range [type=CHARACTER]
SPECIAL[{FLDSEP}]
end CharacterRun:
CharacterRun:Range [type=CHARACTER]
SPECIAL[{DRAWNOBJ}]
end CharacterRun:
CharacterRun:Range [type=CHARACTER]
SPECIAL[{PICTURE}{FLDEND}]
end CharacterRun:
CharacterRun:Range [type=CHARACTER]
[{PARAGRAPHEND}]
end CharacterRun:
end Paragraph:
When does the DRAWOBJ tag come between a FLDSEP and s FLDEND? And when does
it not come between them? What does the tag SHAPE \* MERGEFORMAT mean?
Where can I get some information about the tags of a word 8 file? Tag: autotextlist field control Tag: 58883
Deleting Page Breaks
Word 2000
What is the easiest way to delete all the page breaks in a document? I
recorded the following:
Selection.HomeKey Unit:=wdStory
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^m"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
This seems to work well, but if the document was large it could take a
while to search through the entire document.
I'm wondering if there is another way to do this, maybe by using a
collection or something, where the code would loop through all the page
breaks in the document and delete them. I thought that I was on to
something when I was reading about the Sections collection, but that does
not appear to apply to page breaks.
--Tom Tag: autotextlist field control Tag: 58882
Word Problems with template
Hi Folks,
Can anyone tell me if there is a timeout value for Word to do macro
related tasks?
The Story.......
I have a document automation system that allows users to create new
documents based on the document they have in front of them (for various
reasons). It collects data from the document (text, styles, custom
properties etc.) and includes them in the next document which is created
based on a remote a template (shared drive).
More often than not the original document is on a shared drive, the
Template used to create new documents is always on a shared drive, and
the newly created document is normally created on a shared drive.
Problem I'm having is that somewhere along the line (I think in the
template addition) the macro throws a wobbly and gives a run time error
(my error handling aint great but this isn't part of the problem)
relating to a remote macro.
Now I know this works as I only have the problem in one department and
it's intermittent at that! It works fine everywhere else.
The network connection in this dept is not the best so that leads me to
a timeout of some kind.
Can anyone shed some light on this?
Cheers
J Tag: autotextlist field control Tag: 58880
Why did import of web page cause black and white photo to print o.
When I import a web page by copying into a Word document it changed the
printer so that all my black and white photos now print with an orange tint.
This tint applies to all documents in my files even those not involving the
imported web page. I tried reinstalling printer driver, head alignment,
grayscale. No luck. How do I get rid of this corruption. Tag: autotextlist field control Tag: 58873
hi,
how can i get the click_event fired when i right click mousebutton within a
autotextlist field ,not using vba or macro,but only VB programming?
RE: autotextlist field control by lishaowen23msncom
lishaowen23msncom
Thu Nov 11 13:25:04 CST 2004
And how can i know which field was clicked,also when the left button click?
"lishaowen23@msn.com" wrote:
> hi,
> how can i get the click_event fired when i right click mousebutton within a
> autotextlist field ,not using vba or macro,but only VB programming?