Deleting an image in a header
I have a letterhead template with a logo in the header.
I have a userform which captures details including whether they want to
print it or send it electronically. If they want to print it, I need to
delete the logo (we print on preprinted stationery).
THe image can be either direct in the header or in a table in the header but
I want to keep the header the same depth if the image is delated so a two
cell table with paragraph marks in one cell and the image in the other would
seem to be the easiest. All contact details are in the right margin.
Has anyone any ideas on code that will do it easily - it's a first page
header - I always get confused with story ranges.
--
Regards
Stephen English Tag: Cell Alignment Tag: 78076
Backward compatibility - word2003
Hi,
Is anyone aware of a patch for word2000 that will enable it to read a WordM
XML file produced using Word 2003.
Any help appreciated Tag: Cell Alignment Tag: 78069
Macro to find a marker, format the line, delete the marker
Hi all,
My Situation:
I regularly get plain text documents (*.txt), that are completely
unformatted. Now a macro should do the following for the entire
document:
1. Find all lines starting with " Titel: " (5 x Space, "Titel", 1
x Space)
2. Format the entire line
3. Delete the marke " Titel: " at the beginning of the line.
I managed to write the following code (that even works ;-) :
Sub HighlightTitel()
Selection.HomeKey Unit:=wdStory
With Selection.Find
.Text = "Titel: "
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Do While Selection.Find.Execute = True
Selection.HomeKey Unit:=wdLine
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Font.Name = "Tahoma"
Selection.Font.Size = 16
Selection.Font.Bold = True
Selection.Font.Italic = True
Selection.MoveRight Unit:=wdCharacter, Count:=1
Loop
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " Titel: "
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.HomeKey Unit:=wdStory
End Sub
This seems to be much more code than actually needed, i.e. I am sure
that several lines are redundant.
So I would appreciate any hint for improvement. I am for example very
interessted to get rid of the Selection Object.
Thanks a lot,
Marcus.
Danke, Marcus. Tag: Cell Alignment Tag: 78063
Can I call OfficeCodeBehind (vsto) methods from a Windows Forms app?
Is it possible to call OfficeCodeBehind methods externally? I have created a
Word 2003 template using VSTO 2003, and I would like to call a few of the
methods implemented in the OfficeCodeBehind class from a Windows Forms
application. I know that I can link the methods to CommandBar buttons and
execute them by calling the CommandBarButton.Execute method. What I'm hoping
to do is call them using a syntax similar to the Application.Run syntax that
is used to execute VBA macros.
Here's how I'm calling a method implemented in the OfficeCodeBehind class
from my Windows Forms application now:
object objTemplatePath = "c:\\program files\\microsoft
office\\templates\\FirstVSTOtemplate.dot";
object oMissing = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word.ApplicationClass objApp = new
Microsoft.Office.Interop.Word.ApplicationClass();
Microsoft.Office.Interop.Word.Document objDoc = objApp.Documents.Add(ref
objTemplatePath, ref oMissing, ref oMissing, ref oMissing);
Office.CommandBarControl cbc = objDoc.CommandBars["Menu
Bar"].Controls["Custom Code"];
Office.CommandBarButton cbb =
(Office.CommandBarButton)((Office.CommandBarPopup)cbc).Controls["Populate
Scalars"];
cbb.Execute();
I created a method called PopulateScalars() in OfficeCodeBehind that is
hooked to the Click event of the 'Populate Scalars' menu item. The code
above executes the method, but I have no way to determine when the method
has finished, or what the return value is. What I would like to do ideally
is call the PopulateScalars method directly from my Windows Forms
application.
Any help will be greatly appreciated.
Thanks,
Darryl R. Tag: Cell Alignment Tag: 78055
Merge pop up box
I am using Office 2000 with Windows XP.
I have a database set up in Excel (2000) and several form files setup in
Word (2000).
I need only one merge file at a time. Currently, I select the form file I
want to use, go to Tools Mail Merge, Query, type in the name of the file I
want, choose Merge.
I need to automate this funtion.
This is way to many steps. What I want a box that pops up immediately upon
opening the form file that asks me for the first and last name (file from
excel database)and auto locates that file from the database and merges all in
one step after I type in the first and last name in the box.
Is that to much to ask? I am fairly new so specifics would help. I have
some macro, bookmark and ref, text box experience. But be gentle!
Thank you for your help.
John
--
John R. Tag: Cell Alignment Tag: 78054
Good question for yall
Ok, I have created myself a template, created some macros and "Ask" boxes.
Everything works great when I want to create a new document from an existing
template. But what if I want this template to be a .doc they open up the .doc
and be asked my "Ask" questions. Is this possible?
The quick reason for this is we have a document management system and when
you create a new document you are actually opening up the .dot not creating a
new .doc based on the .dot and so therefore the user is not asked the
questions.
Thanks, Chris A Tag: Cell Alignment Tag: 78050
Formatting with the $ dollar sign symbol
Does anybody know of a way to instantly format numbers so that if you had
$5,000,000
$50
$5,000
...and they had to be center aligned in a column, a way to have the $ signs
line up and the zeros line up?
ex:
$5,000,000
$ 50
$ 5,000
right now I'm using spaces and when you have 80 rows this can be a pain in
the neck. Using Ctrl+tab would be just as bad. Any suggestions? macros or
field code that would do this trick for me. I was hoping maybe a macro that
could find the largest number, count the number of spaces needed in each cell
of the column...and then it would put the correct amount of spacing in.
thanks Tag: Cell Alignment Tag: 78041
Controlling text direction in VB
Hi all
How do I set the text direction property, found under the Format menu, using
Visual Basic? I canâ??t find it anywhere in the object library.
Many thanks
David Tag: Cell Alignment Tag: 78025
Make specified text uneditable in word (.dot)
All,
I have a requirement such that the specified portion of the text in a
word document (.dot) should not be editable by the user. Please
suggest.
Thanks
Srini Tag: Cell Alignment Tag: 78023
How to generate a list of all tracked changes?
Hello!
I would like a way to get a list of all the changes (in tracking changes
mode active).
The idea would be to get a list with the output this somelike:
CHANGES REPORT IN <Document name> by <UserName>
Page Action Line
AuthorOfChange
<Page number> <Insert | Deleted> <Line Number>
<AuthorOfChange>
Does anybody know something done yet to get this?
Thank you!
Manuel Alcaraz (SPAIN) Tag: Cell Alignment Tag: 78022
Use 'GoTo' between different subs, same module?
In the same module, I have a main Sub with a few other Subs containing
repeated routines. Can I place a GoTo line in the main Sub, and then as
part of another Sub have something like:
For Each whatever
If whatever = 0 Then
bolFlag = True
Exit For
.....
If bolFlag = True Then GoTo placeinmainsub
End Sub
Ed Tag: Cell Alignment Tag: 78019
Word Number Index
If I find a word in the document (such as through myWord.Find.Execute), how
can tell which word number this is within the whole document? Tag: Cell Alignment Tag: 78013
How do I create a form field for an image instead of text?
I am creating a document that allows people to fill in information in several
fields. At the end, I want them to be able to paste an image into the
document. Form fields do not work until you "lock" the document. However,
once you lock the document, people can't modify it by pasting an image into a
picture, for example (tried that). I can't seem to find a field that will
accept an image instead of text or number. Am I missing something, or is
this a limitation of the software? Tag: Cell Alignment Tag: 78012
Word VBA superscript
Hi all,
I have a program that automatically creates a document based on fields
the user has selected in a form. It has the ability to create an
English document and a French document and my question is this:
I have a few date fields and if the user has selected the first of
whatever month i output
1er mai 2005 ( for example ) i want to superscript the er but i am
having a hard time figuring out how to do this. I know once you get the
font property you can apply the superscript property but i don't think
you can access the font property on a string and i can't seem to set my
text as a range or a selection. This is what i've tried (i get errors
with this)
Public Sub frenchScript(ByVal documentRange As Range)
Dim temp As String
temp = "1er"
With documentRange.Find
.Text = temp
.Font.Superscript
.Wrap = wdFindContinue
.Execute Replace:=wdReplaceAll
End With
End Sub
any help would be wonderful,
THANKS!! Tag: Cell Alignment Tag: 78007
word textfields automatic fill in end date
In a contract we fill in a date with the next spec.
type: date
format: d MMMM yyyy
bookmark: datum1
result after fill in: 14 december 2005
Two weeks after this date people have to pay, in the document we will that
the date is automaticly displayed in the text. I tried already this, and many
other things but nothing does the job
type: calculation
expression: =Dateadd(date1)+14
bookmark: datum2
result bv: 28 december 2005
Who can help me Tag: Cell Alignment Tag: 78005
printing forms only
I create some forms in a document. So you have some text and afther the text
you have some forms. (or between the text)
I want to print only the forms and not the text. You can chose that option
by printing -> print only forms.
But the problem is that the form is in the middle of the text, the whole
paper is blanco, except the form. And I want to have the form not in the
middle in the text but on line 1, the first sentence.
I want to put all forms automatically together so that when you print, all
forms are together on a paper.
I tried it but I can't do.
I'm thinking about to export the forms to an other dcument, but I don't now
how to do that and if it will work.
Does anyone has an idea or suggestions that will work? Tag: Cell Alignment Tag: 78004
Accessing the methods in a global template
Does anyone know how to access the methods (commands, macros) in a global
addin?
I'm looking for a list analogous to the one you get when you open the Macros
dialog box and select the addin from the "Macros in" list.
Is it in a collection of any kind?
Bear Tag: Cell Alignment Tag: 78003
combo box won't display menu items
I'm trying to put a combo box into a word document in VBA. This is my code
Private Sub ComboBox1_Change()
With ComboBox1
For ComboBox = 1 To 3
.AddItem "Mr"
.AddItem "Mrs"
.AddItem "Ms"
Next ComboBox
End With
End Sub
When I reopen the doccument, the menu items disappear. Would anyone have
any suggestions ? Tag: Cell Alignment Tag: 78002
How to use nextif function in Word mail merge from Excel?
Please help!
I am merging the data from Excel to Word document. I would like to use the
nextif function to put a group of data record in a word document and another
group of data into a new merge document. I had already use the 'next record'
to show multipe records in the same document. As the group changed, it didn't
go to the new merge document. Tag: Cell Alignment Tag: 77997
Headers and footers from newly attached template
Normal.dot has no page numbering assigned, and no headers or footers.
PageNumber.dot has it all (and it also has some other important text in the
headers and footers that I want).
I start a document with Normal.dot as the template.
I 'change my mind' about headers and footers, and now want to attach
PageNumber.dot to the document.
I wrote the following code and attached it to a button
ActiveDocument.AttachedTemplate = PageNumber.dot
Word flashes and obviously has made the connection (and it shows properly in
the Addins and Templates screen), but no headers and footers exist.
Is there a way to call in the headers and footers of an external template
once the document has been started?
Thanks.
Ed Tag: Cell Alignment Tag: 77992
protect toolbar?
Probably not understanding something simple, but can you lock a toolbar so
that it cannot be resized? I tried the code below but it had no effect. If I
changed .Protection to equal msoBarNoMove, it indeed kept me from moving the
bar, but I just don't want users to be able to resize it.
Thanks!
I tried:
Sub CustomToolbar()
Dim myBar As CommandBar
Dim myCtrl1 As CommandBarControl, myCtrl2 As CommandBarControl
Set myBar = CommandBars.Add(Name:="My Command Bar", Position:=msoBarTop,
Temporary:=True)
With myBar
Set myCtrl1 = .Controls.Add(Type:=msoControlButton,
ID:=CommandBars("Standard").Controls("Print").ID)
Set myCtrl2 = .Controls.Add(Type:=msoControlButton,
ID:=CommandBars("Standard").Controls("Save").ID)
.Visible = True
.Protection = msoBarNoChangeVisible + msoBarNoCustomize +
msoBarNoResize
End With
End Sub Tag: Cell Alignment Tag: 77986
Automation and tables
My app is using automation and all is well. Next request involves
'bulletizing' a portion of a cells text. I can programmatically determine
the start and end range of the text inside the cell that we want to
bulletize. Can't seem to get the syntax correct to set the range. I'm using
VFP.
Any ideas? Tag: Cell Alignment Tag: 77983
Compare data strings?
I have a series of data strings I need to compare. I am looking for the one
string that has a character found in no other string. What is the best way
to approach this?
Ed Tag: Cell Alignment Tag: 77966
Help Text on button
I am using word 97 onwards, I have created a small button on a document, the
button has a picture on it so there no space for any text. Is it possible
when the button is hovered over some alternate text is displayed adjacent to
the button? I have seen on some occasions that there is a help text in the
properties window but this is not the case in this instance!
--
Mark Tag: Cell Alignment Tag: 77956
Project Unviewable -word 2000
Hi,
I'm having a problem with a template that contains coding that I created.
When I use VBE, I'm getting a dialog box that says Project locked, and
unviewable. I can't access the coding.
Is there a workaround to this?
jbc Tag: Cell Alignment Tag: 77953
Inserting a tick (check) in front of selective text
Hi,
Please could i ask some advise on a small project that temporarily has me
stumped.
My intention is provide a a userform that is filled with labelled checkboxes.
The label captions match words already present in a word doc arranged in two
columns.
I wish to use vba code to allow the user to check the required checkboxes on
the userform and on hitting the command button, a tick(check) or some other
symbol be placed infront of the coresponding word in the document BUT with
the text not moving to the right to make way for the tick symbol.
Although the words in the doc are arranged in columns they are tabbed in
place. I would prefer not to use columns in the doc for various reasons but
if needs must........
Any suggestions as to how I should proceed.? I just seem to be getting more
and more complicated solutions (that dont work) to what is probably a simple
problem.
Many thanks
Gem_man Tag: Cell Alignment Tag: 77951
Template Frustrations
I'm trying to get the check-boxes to work in a custom template.
I've tried saving as one of the included templates and can get it to
work fine except:
1. The template size blows out to 13mb
2. I can't get the top and bottom margins to 'stick' (even though
when I 'open' the template for editing it appears correct, but when I
start a new one it reverts back to the normal standard).
I have another template that has exactly the same formatting that
appears just as I want it, but I can't get the check buttons to work,
even when I import the same module. It gives me an error: "Requested
member of the collection does not exist".
Any ideas? Tag: Cell Alignment Tag: 77950
User Form/Page Layout question
I have established a template/form for a title page of a proposal. The user
of the template/form would enter the information: title, date, address,
etc...and that would be inserted in to the Title Page (via bookmarks)
formatted appropriately. The length of the title could vary significantly.
However, there are three items at the bottom of the page that I would like
to stay at the bottom of the page. The first of the three is a text box
anchored to the one-row table (with the other 2 items) I have set up (and I
don't want it be a footer) at the bottom of the page.
How can I make it where the items at the bottom of the page stay where they
are regardless of the length of the title and other info that could affect
page placement (there are paragraphs markers (I know, they're awful!) to get
the items in the appropriate place.
Please assist me with:
1. Getting rid of the naked paragraph markers
2. Making sure the info at the bottom of the page stays there without regard
for the length of the title 15 rows above.
I can provide a copy of the template if you need to see it. I apologize in
advance if my description of the problem is unclear.
Laura Tag: Cell Alignment Tag: 77948
Using CancelDefault with a CommandBarButton
Hello,
I'm using "Dim WithEvents btnEmail As CommandBarButton" to drop the click
event of the Mail Recipient (with attachment) in Word. I can catch the event
and fire other actions, but the default action will not cancel. Any
suggestions?
Thanks
Private Sub btnEmail_Click(ByVal Ctrl As Office.CommandBarButton,
CancelDefault As Boolean)
CancelDefault = True
'Do something else instead
End sub Tag: Cell Alignment Tag: 77947
VB Macro to delete text at the end of each of the files in a folde
Please help. I was shocked to discover that all of the files I am working
with have corrupt text at the end.
I have 500 .txt text files in folder c:\rules\. Each file is about 40MB. I
wanted to manually delete the corrupt text, however it takes too long to open
each file in Notepad [because those files are so large].
The first line of each file contains text "Rule=1"
The number following text "Rule=" that is found throughout the files is
incremented by 1 each time this text appears in the file.
May I please ask you to help me by writing a macro that will do the following:
1. Open folder c:\rules\
2. Open the first file in that folder.
3. The macro has to find the second to last line that contains the text
"Rule=". Let us refer to this line as 2toLast
4. The macro should delete all text below the 2toLast line. The macro has
to also delete the 2toLast line.
5. The macro should save the changes made to the file.
6. The macro should go to the next file in the folder c:\rules\, and repeat
steps 3-5
7. Repeat step 6 until run out of files in folder c:\rules\.
Example
The first file in c:\rules\ is called acred2sub1.txt
It begins with text
"Id=23859, Rule=1, Gen=0, training =
11.5444689897386>0.0000>100670.4175{1.9803 1.0000}, selection =
11.6146812264607>0.0000>100688.0767{1.9983 1.0000}, testing =
11.5258096838284>0.0000>101230.9377{-2.3595 1.0000}, trial=0, birth = 0, time
= 1051111.04:43:32 (parents: 0 and 0)
0 Probability GT [1488 0.000000 0.986820]"
This file ends with the text
******************************************************
******************************************************
******************************************************
***********************************************
***********************************************
***********************************************
"Id=2428985, Rule=2291, Gen=48, training =
11.5627062540301>0.0000>100670.4175{2.2533 1.0000}, selection =
11.5616177181233>98280.6602>98280.6602{1.8662 0.9000}, testing =
11.5258096838284>0.0000>101230.9377{-2.3595 1.0000}, trial=0, birth = 48,
time = 1051112.05:31:48 (parents: 2383210 and 2383552)
0 Probability if-thenProb [1488 0.000000 1.000000]
1 Boolean if-then-else [1488 0 1]
2 Boolean if-then-else [1488 0 1]
3 Boolean and [1488 0 1]
4 Boolean any_boolean True [1488 1 1]
5 Boolean < [1488 0 1]
6 Real data [1488 29.125000 143.250000]
7 Variable
8 Real lag [1488 31.107955 139.937500]
9 Real ln [1488 3.371597 4.964591]
10 Real data [1488 29.125000 143.250000]
11 Variable
12 Real mov [1488 31.107955 139.937500]
13 Variable
14 Real days-remaining [1488 1.000000 62.000000]
15 Boolean < [635 0 1]
16 Real power [635 0.000000
3297966952784501300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000]
17 Real abs [635 17777125493.869579 947106196758301.370000]
18 Real power [635 17777125493.869579 947106196758301.370000]
19 Real data [635 29.125000 137.875000]
20 Variable
21 Real any_real 7.000000 0x0000000000001c40 [635 7.000000
7.000000]
22 Real data [635 29.125000 137.875000]
23 Variable
24 Real power [635 0.000000
92510233423514822000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000]
25 Real abs [635 1.000000 3521614606208.000000]
26 Real power [635 1.000000 3521614606208.000000]
27 Real days-remaining [635 1.000000 62.000000]
28 Real any_real 7.000000 0x0000000000001c40 [635 7.000000
7.000000]
29 Real data [635 29.125000 137.875000]
30 Variable
31 Boolean < [853 0 1]
32 Real data [853 33.250000 143.250000]
33 Variable
34 Real days-remaining [853 1.000000 62.000000]
35 Boolean < [78 0 1]
36 Real data [78 29.500000 73.000000]
37 Variable
38 Real power [78 0.000000
3297966952784501300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000]
39 Real abs [78 19442589725.148437 11047398519097.000000]
40 Real power [78 19442589725.148437 11047398519097.000000]
41 Real data [78 29.500000 73.000000]
42 Variable
43 Real any_real 7.000000 0x0000000000001c40 [78 7.000000 7.000000]
44 Real data [78 29.500000 73.000000]
45 Variable
46 Boolean any_boolean False [1410 0 0]
47 Probability ANY_PROB 1.000000 0x000000000000f03f [40 1.000000
1.000000]
Id=2402972, Rule=2292, Gen=48, training =
11.5417736815012>0.0000>100085.4204{1.8968 1.0000}, selection =
11.5609984677956>91748.2451>91748.2451{1.4932 0.9000}, testing =
11.5258096838284>0.0000>101230.9377{-2.3595 1.0000}, trial=0, birth = 48,
time = 1051112.05:07:44 (parents: 2363747 and 2384852)
0 Probability if-thenProb [1488 0.000000 1.000000]
1 Boolean if-then-else [1488 0 1]
2 Boolean and [1488 0 1]
3 Boolean any_boolean True [1488 1 1]
4 Boolean < [1488 0 1]
5 Real data [1488 29.125000 143.250000]
6 Variable
7 Real lag [1488 31.107955 139.937500]
8 Real ln [1488 3.467114 4.843345]
9 Real mov [1488 32.044118 126.893145]
10 Variable
11 Real mov [1488 29.125000 143.250000]
12 Variable
13 Real any_real 0.309681 0xc0520aa2d1d1d33f [1488 0.309681
0.309681]
14 Real mov [1488 31.107955 139.937500]
15 Variable
16 Real days-remaining [1488 1.000000 62.000000]
17 Boolean < [636 0 1]
18 Real data [636 29.125000 137.875000]
19 Variable
20 Real power [636 0.000000
3297966952784501300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000]
21 Real abs [636 17777125493.869579 947106196758301.370000]
22 Real power [636 17777125493.869579 947106196758301.370000]
23 Real data [636 29.125000 137.875000]
24 Variable
25 Real any_real 7.000000 0x0000000000001c40 [636 7.000000 7.000000]
26 Real data [636 29.125000 137.875000]
27 Variable
28 Boolean < [852 0 1]
29 Real + [852 10.625000 257.000000]
30 Real data [852 33.250000 143.250000]
31 Variable
32 Real lag [852 -26.500000 115.750000]
33 Real data [852 33.250000 143.250000]
34 Variable
35 Real - [852 -26.500000 115.750000]
36 Real maximum [852 34.250000 116.750000]
37 Variable
38 Real maximum [852 31.000000 116.750000]
39 Variable
40 Real any_real 7.000000 0x0000000000001c40 [852 7.000000
7.000000]
41 Real days-remaining [852 1.000000 62.000000]
42 Real minimum [852 33.250000 143.250000]
43 Variable
44 Real * [852 1377493611034874400000000000000000000000000000.000000
19946234872205364000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000]
45 Real + [852 34.250000 144.250000]
46 Real any_real 1.000000 0x000000000000f03f [852 1.000000 1.000000]
47 Real maximum [852 33.250000 143.250000]
48 Variable
49 Real days-remaining [852 1.000000 62.000000]
50 Real lag [852 35548222220254824000000000000000000000000000.000000
138275458386172380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000]
51 Real data [852 33.250000 143.250000]
52 Variable
53 Real * [852 35548222220254824000000000000000000000000000.000000
138275458386172380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000]
54 Real / [852 1205024482042536400000000000000000000000000.000000
1184372234571069500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000]
55 Real power [852
22895465158808191000000000000000000000000000.000000
22503072456850322000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000]
56 Real data [852 29.500000 116.750000]
57 Variable
58 Real data [852 29.500000 116.750000]
59 Variable
60 Real any_real 19.000000 0x0000000000003340 [852 19.000000
19.000000]
61 Real data [852 29.500000 116.750000]
62 Variable
63 Probability GT [635 0.000000 1.000000]
64 Real mov [635 32.050000 126.873904]
65 Variable
66 Real minimum [635 29.125000 113.750000]
67 Variable
68 Real + [635 34.283784 179.740079]
69 Real abs [635 32.156250 126.388542]
70 Real mov [635 32.156250 126.388542]
71 Variable
72 Real data [635 29.125000 137.875000]
73 Variable
74 Real days-remaining [635 1.000000 62.000000]
75 Real abs [635 29.125000 137.875000]
76 Real data [635 29.125000 137.875000]
77 Variable
78 Real abs [635 1.000000 62.000000]
79 Real days-remaining [635 1.000000 62.000000]
Id=2426880, Rule=2293, Gen=48, training =
11.5420824603975>0.0000>100670.4175{2.0713 1.0000}, selection =
11.5609196233777>91443.0849>91443.0849{1.4792 0.9000}, testing =
11.5258096838284>0.0000>101230.9377{-2.3595 1.0000}, trial=0, birth = 48,
time = 1051112.05:31:23 (parents: 2386050 and 2356912)
0 Probability if-thenProb [1488 0.000000 1.000000]
1 Boolean if-then-else [1488 0 1]
2 Boolean and [1488 0 1]
3 Boolean any_boolean True [1488 1 1]
4 Boolean > [1488 0 1]
5 Real any_real 76.000000 0x0000000000005340 [1488 76.000000
76.000000]
6 Real data [1488 29.125000 143.250000]
7 Variable
8 Boolean < [743 0 1]
9 Real data [743 29.125000 75.875000]
10 Variable
11 Real power [743 0.000000
3297966952784501300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000]
12 Real abs [743 17777125493.869579 14477411826665.816000]
13 Real power [743 17777125493.869579 14477411826665.816000]
14 Real data [743 29.125000 75.875000]
15 Variable
16 Real any_real 7.000000 0x0000000000001c40 [743 7.000000 7.000000]
17 Real data [743 29.125000 75.875000]
18 Variable
19 Boolean any_boolean False [745 0 0]
20 Probability BOOLEAN [653 0.000000 1.000000]
21 Boolean or [653 0 1]
22 Boolean any_boolean False [653 0 0]
23 Boolean if-then-else [653 0 1]
24 Boolean any_boolean False [653 0 0]
25 Boolean any_boolean False [unused]
26 Boolean < [653 0 1]
27 Real mov [653 32.044118 82.789474]
28 Variable
29 Real data [653 29.125000 75.875000]
30 Variable
31 Real days-remaining [653 1.000000 62.000000]"
***********************************************
***********************************************
***********************************************
***********************************************
***********************************************
***********************************************
The text "Rule=" appears 2293 times in this file. Thus the macro should
find the line containing text "rule=2292" and delete this line and all of the
text below this line. When this is done, file acred2sub1.txt will end with
text
***********************************************
***********************************************
***********************************************
***********************************************
***********************************************
***********************************************
"Id=2428985, Rule=2291, Gen=48, training =
11.5627062540301>0.0000>100670.4175{2.2533 1.0000}, selection =
11.5616177181233>98280.6602>98280.6602{1.8662 0.9000}, testing =
11.5258096838284>0.0000>101230.9377{-2.3595 1.0000}, trial=0, birth = 48,
time = 1051112.05:31:48 (parents: 2383210 and 2383552)
0 Probability if-thenProb [1488 0.000000 1.000000]
1 Boolean if-then-else [1488 0 1]
2 Boolean if-then-else [1488 0 1]
3 Boolean and [1488 0 1]
4 Boolean any_boolean True [1488 1 1]
5 Boolean < [1488 0 1]
6 Real data [1488 29.125000 143.250000]
7 Variable
8 Real lag [1488 31.107955 139.937500]
9 Real ln [1488 3.371597 4.964591]
10 Real data [1488 29.125000 143.250000]
11 Variable
12 Real mov [1488 31.107955 139.937500]
13 Variable
14 Real days-remaining [1488 1.000000 62.000000]
15 Boolean < [635 0 1]
16 Real power [635 0.000000
3297966952784501300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000]
17 Real abs [635 17777125493.869579 947106196758301.370000]
18 Real power [635 17777125493.869579 947106196758301.370000]
19 Real data [635 29.125000 137.875000]
20 Variable
21 Real any_real 7.000000 0x0000000000001c40 [635 7.000000
7.000000]
22 Real data [635 29.125000 137.875000]
23 Variable
24 Real power [635 0.000000
92510233423514822000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000]
25 Real abs [635 1.000000 3521614606208.000000]
26 Real power [635 1.000000 3521614606208.000000]
27 Real days-remaining [635 1.000000 62.000000]
28 Real any_real 7.000000 0x0000000000001c40 [635 7.000000
7.000000]
29 Real data [635 29.125000 137.875000]
30 Variable
31 Boolean < [853 0 1]
32 Real data [853 33.250000 143.250000]
33 Variable
34 Real days-remaining [853 1.000000 62.000000]
35 Boolean < [78 0 1]
36 Real data [78 29.500000 73.000000]
37 Variable
38 Real power [78 0.000000
3297966952784501300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000]
39 Real abs [78 19442589725.148437 11047398519097.000000]
40 Real power [78 19442589725.148437 11047398519097.000000]
41 Real data [78 29.500000 73.000000]
42 Variable
43 Real any_real 7.000000 0x0000000000001c40 [78 7.000000 7.000000]
44 Real data [78 29.500000 73.000000]
45 Variable
46 Boolean any_boolean False [1410 0 0]
47 Probability ANY_PROB 1.000000 0x000000000000f03f [40 1.000000
1.000000]"
Thank you for your kind help! Tag: Cell Alignment Tag: 77946
Delete all comments after cursor position
I need to position the cursor in a document and run a macro to delete
all comments below the cursor (in the rest of the document). Thanks. Tag: Cell Alignment Tag: 77942
How do I scroll a document without scrolling the controls?
I'm trying to create an application where the majority of the screen
contains a loaded Word document. I want the user to be able to scroll
through that document and then add customized comments (textboxes,
actually) at specific locations via a series of controls I have
created. This is working fine.
I need the controls to always be present, even as the user scrolls
through the document.
I tried placing the controls (buttons, etc.) in one cell of a table and
the document in another, larger cell, but I cannot get the document
cell to scroll.
Can anyone help with guidance on the best approach to do this?
Thanks very much Tag: Cell Alignment Tag: 77939
wingdings error from 9/11
Can someone please fix the Microsoft Word Wingding error where when you type
in the 9/11 flight number in wingdings, it becomes something irrational? I
would figure that Microsoft can fix these types of co-incidents/problems with
Microsoft. I would really appreciate it if you can do that for me.
----------------
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=f15275a1-8b9d-4949-898a-cea0aae516d4&dg=microsoft.public.word.vba.general Tag: Cell Alignment Tag: 77933
VBA used to create automatically increment invoice number
I used the Macro on the web site (Article ID : 212686) to create an Insertion
order form, each of which must have a unique number. The macro worked great
but the next step is to enter the number in our corporate system. The number
must be a 5-digit number.
I've never used Visual Basic before and am trying to understand how I can
change the number format in the form or in the macro to start at 00001.
Everything I've tried so far does not take.
We go through insertion orders like potato chips. If I could figure out how
to format to 5-digits through the macro named above, I would be raised on a
pedestal by my boss. Tag: Cell Alignment Tag: 77930
Un-tripping security settings in Word
I've just added a new sub-procedure to our word template (we use large
macros extensively), but I can't get the macro to enable. It's a macro
I wrote from scratch and added to the toolbar. The security settings
disable the macro even though my security is set to low and I have
trust all add-ins and templates selected, and trust access to VB
project selected. I've tried re-starting a couple of times and nothing
is working. I went to microsoft.com and couldn't find any information
other than "set your security lower".
I've had this happen before, and it's really hampering our abilities to
write macros.
Has anyone else run into this? Any help would be most appreciated. Tag: Cell Alignment Tag: 77929
Pulling Middle Initial and Suffix from Address Book
I have looked everywhere for an answer to this, but I can't seem to come up
with anything. I have a macro that will pull the mailing address of a person
over into a blank TextBox on a UserForm. The problem being I dont know what
command to use to get the Middle Initial and Suffix...
Ex. strAddress = Application.GetAddress(strName, "<PR_DISPLAY_NAME_PREFIX>
<PR_GIVEN_NAME> <PR_SURNAME>" & vbCr & "<PR_TITLE>" & vbCr &
"<PR_COMPANY_NAME>" & vbCr & "<PR_STREET_ADDRESS>" & vbCr & "<PR_LOCALITY>,
<PR_STATE_OR_PROVINCE>" & " " & "<PR_POSTAL_CODE>", , 2)
Result:
Mr. John Doe <-- Should be Mr. John E. Doe, Sr.
President
JD Enterprises
111 SW Somewhere
Nowheresville, MI 98765 Tag: Cell Alignment Tag: 77924
Which range contains this table cell?
I have a large table with several named ranges. How can I find which named
range a particular cell is a part of?
Ed Tag: Cell Alignment Tag: 77920
ChangeFileOpenDirectory doesn't always work
We use the following macro code to open our directories:
Sub Open1()
'
ChangeFileOpenDirectory "W:\1\"
Dialogs(wdDialogFileOpen).Show
End Sub
We have a macro just like the above for each folder, i.e. w:\2\, w:\3\, etc.
The problem is running the macro only works if the user does not open a
document. If s/he does open a document, the next time the macro is run, it
simply opens up My Documents. Is there any way that the code can be modified
so that the macros always work, regardless of whether a document was opened?
Claudia Carvalho Tag: Cell Alignment Tag: 77919
Runtime Error 509
I have a protected document created from a template, our programmers are
trying to use a shellexecute print command to print the document, however the
TmpDDE command that is created errors with Runtime error 509 because it is
trying to do a "WordBasic.SetDocumentDirty t"
The same thing happens if you right click and do print from the Windows XP
explorer.
This only seems to be a problem in Office 2003.
Does anyone know if there is a way supress the dirty flag or this error?
Thanks Tag: Cell Alignment Tag: 77914
Headers should not appear in the first section.
I'm trying to create a macro that sets the headers for a document in the
following way:
- Odd & even pages have different headers (no problem here);
- The first 2 pages of the document should not contain any headers (these
pages make up section 1 of the document) (problem here);
- Page numbering should start from 1 on the third page (which is the first
page of section 2) (no problem here);
- The remaining pages of the document are in various sections.
The problem so far is that I can't get this to work in any way (not even
manually). I always end up with a header on page 2 (but not on page 1,
although I mentioned that the first page should not be threated special.)
I'd be very happy with code advice or anything that enables me to create a
correct situation manually first.
Kind regards,
rVo Tag: Cell Alignment Tag: 77913
Programmatically setting margins not working
Hello Everyone, I posted this message back in May but was then pulled
off of the project and onto something new and didn't have time to
revisit it. I am still having this exact error. The program is actually
sitting on a network drive on a windows 2000 box and when the user open
from there the margins are set the same as the normal template and have
not changed to what i set them too, they do not experience any error
messages or anything out of the ordinary. Any ideas would help
greatly!!
I have a macro that produces a word document when all is said and done.
I have some code that goes and sets the margins programmatically, the
code is as follows:
Set myRange = ActiveDocument.Range
With myRange
.PageSetup.TopMargin = CentimetersToPoints(1)
.PageSetup.BottomMargin = CentimetersToPoints(1)
.PageSetup.LeftMargin = CentimetersToPoints(0.9)
.PageSetup.RightMargin = CentimetersToPoints(0.9)
.Font.Size = 11
.Font.Name = "Times New Roman"
End With
this works perfectly when i run it on my own machine but when it's run
on other people's machines it doesn't work at all. I should also note
that the font setting works on any computer and that the page margins
and font are different in Normal.dot on my computer and the others i
have tested on. Am i doing something wrong??
Thanks,
Erin Tag: Cell Alignment Tag: 77906
how to digitally sign XML documents step by step
Hi
I would like to digitally sign the XML documents I am producing from word .
Has anyone of you relevant knowledge to guide me step by step ?
Any help mostly appreciated
Regards Tag: Cell Alignment Tag: 77905
Toolbars, Add-ins, etc.
Hi all,
I've been tasked with writing a transcription program. I have to use Word. I
have some questions about programming in Word. I've done a bit of automation
in the past. The basics are that the application will be a fat client
residing on the users machine. The app starts with a login screen. The user
types in a user name/password and clicks a button. The username and password
are submitted to a webserver for authentication and profile retrieval. Upon
successful logon, the app will start an instance of Word. There will be a
custom toolbar with all the buttons the user will need to request new jobs,
etc. All data needs to be transferred back and forth through an SSL
connection to the web server. Will be utilizing Word 2003. I apologize in
advance for my lack of knowledge in Word terminology. Anyhoo...
Toolbars. Can I create a custom toolbar (with my own custom actions that
will be performed upon clicking) that will only be available (visible?) under
certain circumstances. Say, perhaps, when a certain template was loaded? I
understand I can put the toolbars in a template document ( .dot file). Is
this correct? I don't particularly want to do that. There will be a "generic"
template but there will also be at least 4 different templates for each
client. The templates can not be stored on the local drive either (they must
be "fed" to the application upon user request). I was thinking an Add-in
here. But, I don't want the toolbar to load if say, the user starts Word the
"normal" way to type a letter to grandma, etc.
How can I load a document template from a url? I need to do this without
"prompting" the user at all. The template, I suppose, could be saved
temporarily on the users hard-drive and then loaded from the hard-drive. I
would like to load it from the url and not have to save it to the hard-drive
first.
How can I save a document back to a web server? I cannot save it back to a
drive letter:\path because there won't be any mapped network shares. I cannot
allow the user to save the document on their local hard-drive either. I do
not want to "prompt" the user.
The document templates will have "fields" or "tags". For example, lets say
there are 5 tags: tag1, tag2, ...tag5. Let's say the cursor is in between
tag2 and tag3. Is there anyway I can capture the "tab" key such that when the
user presses it, it tabs between tags? For instance, say the cursor is in the
above mentioned place, the user presses the tab key and the cursor moves to
the "start" of the next tag (tag3). If the user presses "shift + tab" the
cursor moves back to the previous tag (tag1).
That's all I have for now. I'm sure I'll be back. Thanks a bunch for any
suggestions, hints.
David Tag: Cell Alignment Tag: 77904
Disable Fieldcode 'Fillin'
In a doc the fieldcode 'Fillin' is used.
When using this document in a vb script (in this case printing) a window wil
open and show the contens of the Fillin code.
I like to disable the filin code during printing;
========================================================
FileName="D:\KLANTEN\Stork\TESTENV\vb\jim.doc"
PrinterName = "STORKH08815"
Dim WordObj
' On Error Resume Next
Set WordObj = CreateObject("Word.Application")
' This doenst work :-) WordObj.Wdfieldtype.wdfieldfillin = False
WordObj.Documents.Open FileName
WordObj.ActivePrinter = PrinterName
WordObj.PrintOut
WordObj.Quit
===============================
Thnx
--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-programming/200512/1 Tag: Cell Alignment Tag: 77903
Replacing Styles
I have two questions concerning using a macro to find styles and replace them
with other styes.
First I am using this code to find and replace a styles
'
' Finds Style "Heading 4" and Replaces it with Style "Heading 3"
'
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
On Error Resume Next
Selection.Find.Style = ActiveDocument.Styles("Heading 4")
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Style = ActiveDocument.Styles("Heading 3")
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = True
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
I have many styles that are currently in a word document that I want the
macro to find and replace with the style body for instance. Is there a
better way to code this so that maybe five or more different styles can be
replaced with the style body.
My second question is if there is a way to code a find replace to replace an
inline style (maybe wrong terminology) with a defined style.
For example, replacing "body + bold" with "emphasis"
Thanks for any help,
--
Michael Tag: Cell Alignment Tag: 77896
How to Add field codes to table in footer?
In using VBA I need to add a 1 row, 2 column int the footer. In the left
column I need to display the current date and in the right column display
page of pages. I can create the table, display the current date, but I
cannot seem to add the page of pages to the right column.
The error message I receive is: This command is not available.
What I am trying to do is grab the cell as a range, then use that range to
get the field result. I have used the activedocument.fields.add method, but
it displays the the results right on document and not where I need it.
Does anyone have any suggestions?
Here is my code:
Dim myRange As Range
Dim strPageFld As String, strTotPageFld As String
With ActiveDocument
Set myRange = .Sections(1).Footers(wdHeaderFooterPrimary).Range
.Tables.Add Range:=myRange, NumRows:=1, NumColumns:=2
myRange.Tables(1).Cell(1, 1).Range.ParagraphFormat.Alignment =
wdAlignParagraphLeft
myRange.Tables(1).Cell(1, 1).Range.Text = Format(Date, "MMMM dd,
yyyy")
Set myRange = myRange.Tables(1).Cell(1, 2).Range
myRange.ParagraphFormat.Alignment = wdAlignParagraphRight
strPageFld = myRange.Fields.Add(myRange, wdFieldPage).Result
strTotPageFld = myRange.Fields.Add(myRange, wdFieldNumPages).Result
myRange.Text = strPageFld & " of " & strTotPageFld
End With Tag: Cell Alignment Tag: 77895
Removing all formfields from Doc
What's the deal with this code? It errs when X = 6, although there are 9
FF's in the document.
Sub deleteFFs()
Dim X As Integer, tTotal As Integer
tTotal = ActiveDocument.FormFields.Count
For X = 1 To tTotal
ActiveDocument.FormFields(X).Delete
Next
End Sub
I tried writing something using "For each FF in ActiveDocument", but I don't
know how to loop without using names or indices. It must be tooooo
simple....
TIA Tag: Cell Alignment Tag: 77894
In WORD, Interactive FORMS?
Can a FORM set up in Microsoft Word be designed such that, via the use of a
MACRO, the form will prompt a user for specific field(s) information, and
then have the MACRO test selected field(s) for the presence of data? Ex. A
FORM asks for name, address, phone no. etc. information...the individual
field(s), or name, address, phone no., are validated via a MACRO...Thanks for
your assistance. Tag: Cell Alignment Tag: 77891
Hi I am trying to set the cell Alignment of a table I can do it with the
right click menu but not by code can anyone help please?.
TIA
Charles