Controlling The Order of User Namespace Declarations
Here is a question specific to WordprocessML resultant instance output whose
root element is w:wordDocument.
If I employeed multiple user schemas in my Microsoft Office Word 2003
document, how would the order of associated namespace declarations be
decided?
For instance, if two schemas www.mycompany.org/schema_a.xsd and
www.mycompany.org/schema_b.xsd were employeed, who would be deciding that
namespace ns5 is assigned first to www.mycompany.org/schema_a.xsd and then
ns6 to www.mycompany.org/schema_b.xsd rather than the reverse order?
Can doument author have any control in this regard? If yes, how to do that?
Any advice is appreciated.
Regards,
Spenser Tag: hi Tag: 107954
Macro Recording Process Acieved Macro Goal, Macro Itself Fails
I recorded a macro as I simultaneously (1) searched for all paragraphs of
outline level 8 and beginning with the text â??i.â?? followed by a tab character
and (2) replaced each instance of the above text with â??[a]â?? followed by a tab
character, and applied various formatting characteristics to each paragraph
found (including outline level 9). I was successful during the recording
process, but the resulting macro doesnâ??t work. Instead, I am informed that
â??0 replacements were madeâ??. (Of course, I had restored the search target to
the text.) The code, recorded automatically, is as follows:
Sub i__DemotedByJAW()
'
' i__DemotedByJAW Macro
' Macro recorded 11/23/2007 by James Watson
'
Selection.Find.ClearFormatting
With Selection.Find.ParagraphFormat
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
.OutlineLevel = wdOutlineLevel8
End With
Selection.Find.ParagraphFormat.Borders.Shadow = False
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.ParagraphFormat
.LeftIndent = InchesToPoints(1.75)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.FirstLineIndent = InchesToPoints(0)
.OutlineLevel = wdOutlineLevel9
.CharacterUnitLeftIndent = 0
.CharacterUnitFirstLineIndent = 0
.LineUnitBefore = 0
.LineUnitAfter = 0
End With
Selection.Find.Replacement.ParagraphFormat.Borders.Shadow = False
With Selection.Find
.Text = "i.^t"
.Replacement.Text = "[a]^t"
.Forward = True
.Wrap = wdFindAsk
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Many thanks in advance for whomever assists me.
James Watson Tag: hi Tag: 107952
Ribbon Status
In a procedure I am writing I need to know if the Ribbon is displayed or
not.
I found ActiveWindow.ToggleRibbon which shows or hides the ribbon, but
couldn't find anything to tell me if it was showing or not.
Thanks.
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word. Tag: hi Tag: 107951
"Paste Special - Unformatted Text" Macro
Hi. Can somebody tell me how to create a macro to . . .
"Paste Special . . . UNFORMATTED Text"
(I've tried clicking onthe "Paste" toolbar icon during macro-creation, and
even though I DO try to record the "Unformatted Text" option, before closing
the recording . . . . when actually executing, the macro just performs a
STANDARD paste . . . i.e. NOT unformatted!)
Ugh.
Thanks for anybody's help. Tag: hi Tag: 107943
Passing Ms Word Data To Access
I have built a MS Word 97 form that sends data in the bookmarks to a
table in Access 97 when I click a command button on the Word form.
With the help of Robert Morley, Thanks Rob, I am able to get the data
into the Access table. The problem is that if a bookmark is a Date/
Time or Number and contains no data, I get the run time error 13 "Type
Mismatch" message. If the bookmarks contain data or is a text field,
the data fills the Access table fields just fine. I have placed data
in all of the bookmarks and everything works.
What code do I need to add to get this working
I'm also wondering if the same thing will happen with the text
bookmarks that have no data.
Many thanks to all of you guys and gals who so freely contribute your
knowledge to help people like me who know just enough to be dangerous.
Your help has gotten me out of many a jam.
Ron
Here's the code
Private Sub cmdSendToAccess_Click()
Dim strfldPerAssign As String '(Text field)
Dim strfldAccNum As Long '(Text field)
Dim strfldEventNum As String '(Text field-contains numbers and
letters)
Dim strfldEventDate As Date '(Date/Time field)
Dim strfldReqDate As Date '(Date/Time field)
Dim strfldCompleted As String '(Text field)
Dim strfldApp1 As String '(Text field)
Dim strfldApp1Shift As String '(Text field)
Dim strfldStartTime1 As Date '(Date/Time field)
Dim strfldEndTime1 As Date '(Date/Time field)
Dim strfldTotalTime1 As Date '(Date/Time field)
Set ThisDoc = ActiveDocument
strfldPerAssign = ThisDoc.FormFields("fldPerAssign").Result
strfldAccNum = ThisDoc.FormFields("fldAccNum").Result
strfldEventNum = ThisDoc.FormFields("fldEventNum").Result
strfldEventDate = ThisDoc.FormFields("fldEventDate").Result
strfldReqDate = ThisDoc.FormFields("fldReqDate").Result
strfldCompleted = ThisDoc.FormFields("fldCompleted").Result
strfldApp1 = ThisDoc.FormFields("fldApp1").Result
strfldApp1Shift = ThisDoc.FormFields("fldApp1Shift").Result
strfldStartTime1 = ThisDoc.FormFields("fldStartTime1").Result
strfldEndTime1 = ThisDoc.FormFields("fldEndTime1").Result
strfldTotalTime1 = ThisDoc.FormFields("fldTotalTime1").Result
Set wrkjet = CreateWorkspace("", "admin", "", dbUseJet)
Set MyDB = wrkjet.OpenDatabase("E:\App\WorkCompleted")
Set MyTbl = MyDB.OpenRecordset("JobAssignments")
With MyTbl
.AddNew
!PerAssign = strfldPerAssign
!accNum = CLng(strfldAccNum)
!EventNum = strfldEventNum
!EventDate = CDate(strfldEventDate)
!ReqDate = CDate(strfldReqDate)
!Completed = strfldCompleted
!App1 = strfldApp1
!App1Shift = strfldApp1Shift
!StartTime1 = CDate(strfldStartTime1)
!EndTime1 = CDate(strfldEndTime1)
!TotalTime1 = CDate(strfldTotalTime1)
.Update
End With
Set MyTbl = Nothing
Set MyDB = Nothing
Set wrkjet = Nothing
End Sub Tag: hi Tag: 107932
Link (OLE) with relative path
Hi
I have a framework of word documents which all have to link to a generic
word document which is always placed relative to the famework.
I would like to make the link in the documents with a relative path, instead
of the absolute path which is generated when using "paste special/link"
function.
I have tried to modufied the path in the "fields" but I cannot make it work
as expected.
This is what it looks like
{ LINK Word.Document.8 "\\\\Servdk03\\pharma\\LKP08_master\\Stamdata.doc"
"OLE_LINK19" \a \p }
This is what I'm looking for.
{LINK Word.Document.8 "\\..\\..\\..\\Stamdata.doc" "OLE_LINK19" \a \p}
However that doesn't seems to work.
--
BR
Henry Tag: hi Tag: 107911
No ProgID is available for this object.
I have an Excel Chart object (Excel.Chart.8) in MS Word document. I'm trying
to access the chart. But I sometimes get an error. The following is my
program.
Dim i As Integer
Dim strProgId As String
For i = 1 To gwdDoc.InlineShapes.Count
With gwdDoc.InlineShapes(i)
If .Type = wdInlineShapeEmbeddedOLEObject Then
'wdInlineShapeEmbeddedOLEObject=1
strProgId = .OLEFormat.ProgId 'I sometimes get an error
If Left(strProgId, 11) = "Excel.Chart" Then
.OLEFormat.Activate
Set objOLE = .OLEFormat
Exit Function
End If
End If
End If
End With
Next i
I debuged the code. I can not somtetimes access the property ProgId, and get
the error message. "No ProgID is available for this object."
Sometimes it is OK. sometimes it is error. Very strange. I accessed the
property ClassType, and I get the value "Excel.Chart.8".
Any idea?
Thanks advance,
Liu Jianzhong Tag: hi Tag: 107909
Arrays
document.new
I get the userid from a module and want to populate a text field with the
user's phone extension.
Here's an example of user's and phone ext:
bjsorens336
rewelin415
reellis613
Thanks,
Bryan Tag: hi Tag: 107902
Word2000+Word2003=CPU Usage 100%!!
I have this program that works with word objects, and it did work just fine
until someone tried to run it on PC that somehow has both Word2000 and 2003
on it. And when programm created word application object CPU just expledes.
--
..., but the beer is still good! Tag: hi Tag: 107896
Auto select drop down value
On document.new, I am pre-loading fields with info from our host system.
I need to auto select a drop down value based on a value in text1.
For example let's say the drop down list contains
WNA
WNI
PMI
if text1 = '1' then I want to auto select WNI in the drop down
Thanks in advance,
Bryan Tag: hi Tag: 107895
Dialog 98
Word 2007
I don't know the constant name for the dialog that displays when you click
on the right hand "X" to close a document, but I can make it appear with:
Sub Testing()
Dialogs(98).Show
End Sub
What I can't figure out, is why it causes a RunTime Error 4198 "Command
Failed" if I click "Cancel" or the "X" in the dialog.
Second issue
I am trying to intercept the FileSave and FileSaveAs commands and perform an
action on save. I have that part figured out, but I need to sort out how to
make it work if the user clicks the "X" or the "Close" command on the Office
Menu. I have put code in the Document_Close Event and I only want a part of
it to execute if the user choose to Save the file and not execute if they
canceled out of the dialog, close the dialog with the "X" or select not to
save the file.
It seems like the Document_Close event is fired before that dialog appears.
I can't figure out how to determine what the User does in that dialog:
What doesn't work and I think I kno why is something like:
Private Sub Document_Close()
If Dialogs(98).Show = -1 Then
'Call a procedure"
Else
'Do nothing
End If
End Sub
Help, Help, Help!
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word. Tag: hi Tag: 107880
How to get Save Event from word using Automation?
Hi,
I am using Word Automation. I got the documentevents for Close & Open. Now
I want the events for Save. I got article from msdn but that is for .net
(BeforeSave).
I want for Save Event for following
Word::DocumentEvents
SSD Tag: hi Tag: 107874
Macro problem with Word 2007
I paste a lot of pictures into my report, and I would like to size them each
time I add a picture (picture format size heigh & width).
I recorde a macro using Word XP with no problem. However, with Word 2007, I
am having the following issues during recording (a cassette tape icon
appears):
1) I cannot click on the picture to select
2) I use the keyboard to select the picture
3) I use the ribbon to access the picture formating toolbar and enter height
& width
4) I stop the macro recorder
When I do this, nothing gets recorded. Tried several different methods with
no luck. The only time it does record something is if I type a word. Again,
no macro records when I select the picture and try to do something with it.
Very annoying. BTW, same results starting Winword /A.
Thank you for your help in advance. Tag: hi Tag: 107872
Autoexec not running
I have a template I have been working on. It was password protected and I
went under protect document and unprotect it. I saved and closed the
template. But when I try and reopen it, Word asks for the password. When I
type in the password the template opens. But when it opens the AutoExec macro
does not run. If I manually run the macro; it works fine. Itâ??s as if the
AutoExec macro does run because the template is still protected some how. Any
ideas on this would be helpful.
LEU Tag: hi Tag: 107871
Picture Formating in a macro
Hi there,
I'm trying to change the formatting of a picture through a macro. I
have managed to change the size of the picture, but I'm unable to
change the text wrapping options.
I would like to have my graph which is 3.95" in width, aligned to the
right margin, with text (that is fully justified) wrapped on the left
of the graph.
This is what I have so far. Can you help me with the rest?
Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
With Selection
.WrapFormat.Type = wdWrapSquare
.RelativeHorizontalPosition = wdRelativeRightMargin
End With Tag: hi Tag: 107868
Dialog Index 98
Word 2007
I don't know the constant name for the dialog that displays when you click
on the right hand "X" to close a document, but I can make it appear with:
Sub Testing()
Dialogs(98).Show
End Sub
What I can't figure out, is why it causes a RunTime Error 4198 "Command
Failed" if I click "Cancel" or the "X" in the dialog.
Second issue
I am trying to intercept the FileSave and FileSaveAs commands and perform an
action on save. I have that part figured out, but I need to sort out how to
make it work if the user clicks the "X" or the "Close" command on the Office
Menu. I have put code in the Document_Close Event and I only want a part of
it to execute if the user choose to Save the file and not execute if they
canceled out of the dialog, close the dialog with the "X" or select not to
save the file.
It seems like the Document_Close event is fired before that dialog appears.
I can't figure out how to determine what the User does in that dialog:
What doesn't work and I think I kno why is something like:
Private Sub Document_Close()
If Dialogs(98).Show = -1 Then
'Call a procedure"
Else
'Do nothing
End If
End Sub
Help, Help, Help!
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word. Tag: hi Tag: 107864
Run Time error on Code
I'm using a bit of code to save a document as and automatically populating
the file name with form field data.
Seems to work fine...the Save As Dialog appears, the proper field names are
there for the save as, but then if you click "Save" I get a run error
"Run-time error '-2147(bunch of other numbers)'
Command failed
And that's it. Any idea what I'm supposed to do to fix this? here's the
code I'm using:
response = MsgBox("Form Complete! Do you want to save this survey now?",
vbQuestion + vbYesNo)
If response = vbYes Then
Dim dlg As FileDialog
Set dlg = Application.FileDialog(msoFileDialogSaveAs)
With dlg
.InitialFileName = "c:\Documents and Settings\My Documents\Survey -
" + ActiveDocument.FormFields("textLast").Result + ", " +
ActiveDocument.FormFields("textFirst").Result + ".doc"
If .Show Then .Execute
End With
End If Tag: hi Tag: 107863
using drop down field in macros
I have a from with drop down fields that I would like to be able to use with
a macro. When I try to create the macro, it allows a place for the drop down
but I cannot include the list in the drop down while in the macro. I have
only been able to run the macro and then add the list to the fields then. I
want the list to be included in the macro. Is this possible? Tag: hi Tag: 107859
Bug: Problem when viewing headers/footers by double-clicking
We have a macro in a special template that replaces the native ViewHeader
logic in Word. Whenever a user clicks on the menu item 'View/Header and
Footer', our macro kicks in. This has been working great since Word 2.0. We
have just discovered a problem in Word 2003. If a user selects 'View/Print
Layout' and then double-clicks in the header area of the page, Word opens the
section for the user to edit (this is what we can't allow). I would have
expected our macro to start but it appears that Word is running some other
code (anyone know what is run when the header section is double-clicked).
Also, the 'Header and Foote'r toolbar then appears and if the user clicks
'Close', Word runs the ViewHeader macro (which is completely backwards).
This sure appears to be a bug in Word.
Anybody know how to intercept the double-click on the header section and how
to disconnect the close button on the toolbar from running the ViewHeader
code? Tag: hi Tag: 107855
How do I convert all older Word files on a server to 2007 format?
Apparently a security fix in service pack 3 for Office is preventing older
word files from being opened.
When the users try to open they get a message:
"You are attempting to open a file that was created in an earlier version of
Microsoft Office. This file type is blocked from opening in this version by
your registry policy setting."
I found an article regarding this at http://support.microsoft.com/kb/922849
We are going to apply the policy templates but my boss wants a better
solution. He thinks that if Microsoft is blocking these files by default we
cannot ensure there future in new versions of Office.
What would be the best way of accomplishing an upgrade(conversion?) of all
documents on a server to 2007 format?
We were thinking possibly a VB or a VBA script, but there has to be a better
way of accomplishing this.
Thanks for any advice offered.
Joshua Tag: hi Tag: 107853
How do I convert all older files on a server to 2007 format?
Apparently a security fix in service pack 3 for Office is preventing older
word files from being opened.
When the users try to open they get a message:
"You are attempting to open a file that was created in an earlier version of
Microsoft Office. This file type is blocked from opening in this version by
your registry policy setting."
I found an article regarding this at http://support.microsoft.com/kb/922849
We are going to apply the policy templates but my boss wants a better
solution. He thinks that if Microsoft is blocking these files by default we
cannot ensure there future in new versions of Office.
What would be the best way of accomplishing an upgrade(conversion?) of all
documents on a server to 2007 format?
We were thinking possibly a VB or a VBA script, but there has to be a better
way of accomplishing this.
Thanks for any advice offered.
Joshua Tag: hi Tag: 107852
User Form duplicates information when sub is cancelled
Hello all
I have made a user form to populate a Word 2003 template. I have added a
piece of code that exits the population of the document if the required
fields aren't filled in, it reads like the sample below:
If Len(Trim(cmbDiv.text)) <= 0 Or Len(Trim(cmbDept.text)) <= 0 Or
Len(Trim(txtEMail.text)) <= 0 Then
MsgBox "You must fill in all the required fields"
Exit Sub
ElectronicOption.Enabled = True
End If
The code works, however what happens is that if the code is exited the form
has already placed some data in the template, and it duplicates it. So
instead of for example seeing the Department name as "Sales and Marketing",
you see it as "Sales and Marketing Sales and Marketing". I thought I would
have to write something like me.refresh before Exit Sub, but I can't find
anything in Word vba like that, I tried Repaint, but that didn't work.
I think the problem is that the data is already there, and when the rest of
the fields are filled in and the OK button clicked, the fact that some of the
data was already there is not recognised, and in that case I don't know what
to do. Does anyone have any ideas?
Thanks for all your help
Aehan Tag: hi Tag: 107846
Delete single newline between tables
I'm fighting with a document automation system and can't seem to get
what I want from it directly, and am trying to switch over to
attacking it from the post processing side. The closest I can get the
tool to produce to the desired output is a series of single row tables
with a single newline between them.
Can I write a macro to detect that pattern and delete the new line
(merging the single row tables into the complete table I want)? Tag: hi Tag: 107845
Next Bullet
Im trying to create a macro that adds the text in textbox1 to the end of a
bulleted list in cell B2. All I can seem to do is replace the cells text
with the entire contents of textbox1 ...... but again I just want to add a
bullet the list that is already in the cell. Any help would be appreciated!
HAPPY THANKSGIVING!
Ben Z. Tag: hi Tag: 107844
ChangeFileOpenDirectory
I have installations of the identical VBA program on 20 different computers.
I use the following command with some frequency.
ChangeFileOpenDirectory newpath
With Dialogs(wdDialogFileOpen)
.name = "*.doc"
CloseNum = .Show
End With
The command works perfectly on 19. One the 20th it refuses to work. The
MyDocuments folder consistently opens when the section of code is
encountered.
I have doubled the "ChangeFileOpenDirectory newpath" command (I found that
suggestion on a board) but that doesn't work either.
When I step through (debugging) the vba code it works fine, so I know that
the connections are intact.
Any thoughts?
Ed (in Virginia) Tag: hi Tag: 107838
startup folder problem
Hi!
I have a problem with my global template. I have made several templates and
since the most of the functions I have made are the same for the templates I
have put my code in two global templates. I have organized my templates in
some folders and in Word I set the path to the templates and to the startup
folder. It works fine most of the time, but... If I do not have Word open,
right click on a document in explorer and choose print then I get the message
"could not open global.dot". However if I copy the global templates to
C:\Program files\Microsoft Office\OFFICE11\STARTUP it works. Why? I meen I
did change the path for the startupfolder in word but it does not seem to
matter. Is it something special with this "default" startup folder? Tag: hi Tag: 107834
document.Merge() gives inconsistent results
(this is a copy of a post I sent to a couple other groups but haven't had a
reply)
hello,
in office 2003, if you did
document1.Merge(document2)
it would report a line that is in document1 but not in document2 as
inserted, and a line that is in document2 but not in document1 as deleted.
i.e. it would assume that document1 is the "new" document and document2 is
the "old" document.
in office 2007 it is almost always the other way round i.e. assumes
document1 is the old and document2 is the new (AFAICR this is the same as
previous versions of office before 2003 used to do)
no problem so far, I just detect in my application (c# .net 2.0 FWIW) which
version of word I am connected to, and set the sense of the comparison
accordingly
HOWEVER, under office 2007, for some pairs of documents, I get the same
result regardless of whether I call:
document1.Merge(document2) or
document2.Merge(document1)
I.E. word 2007 is "intelligently" deciding which is the "new" and which is
the "old". from my experiments it does not seem that this has to do with the
file time stamp or the 'last saved' property.
Does anyone know how word 2007 decides which is the newer document and if
there is any way I can override it to force the sense of the comparison.
TIA
Andy Tag: hi Tag: 107833
Read & Write Files in Document format with out installing MSWord.
Hi All,
I am need of a dll or code that can operate on Document format files with
all the properties. I must be able to add text, read text, place
headers/footers, align pargraphs e.t.c. I must do all these with out
Installing MSword in my machine.
Is this possible, if so can anybody help me please....
Thanks & Regards,
M.Satyanarayana. Tag: hi Tag: 107831
Retrieve full path to an attached template when path doesn't exist
Hi there,
We are using Microsoft Office 2000.
Our Workgroup Templates path is going to change, so I need to write a macro
to update the path if appropriate.
I know I can retrieve properties about an attached template using
ActiveDocument.AttachedTemplate.<Property> if the file exists.
I can also get the name of the attached template using
ActiveDocument.BuiltInDocumentProperties(wdPropertyTemplate).
Is there a way to retrieve the value in the Tools ==> Templates and
Add-In... Template field when the path to the template no longer exists.
Regards,
Barry. Tag: hi Tag: 107821
Trouble with First Page Different in a Word Document Macro
I have a memo template with the company logo on the first page in a header
and nothing in the footer. If the memo goes more than one page, from page 2
to the end have no header, but do have a footer with the page number and a
smaller company logo. Because of this, First Page Different is checked off
in Page Setup. Some people want to be able to insert a landscape table page
into the middle of the document. When they section off the document to add
these pages, the logo from the first page is displayed on their page. I am
trying to create a macro to help the staff that are trying to do this, by
having the macro insert the landscape page with the footer that is on all of
the pages other than the first page (the page number and smaller logo),
followed by a portrait page so they will be ready to type again. However, I
cannot get the macro to stop putting in the logo from the first page, even
though I have .DifferentFirstPageHeaderFooter = False. I only know how to
create macros by example, so this is difficult for me. I hope you can help,
because I've tried everything. Thank you for your time. Tag: hi Tag: 107817
Cannot set language from macro in Word 2007.
I have a selection that includes some Unicode characters (specifically
Pinyin). The pinyins are treated as if Chinese and are rendered using
the font for Far Eastern Text, which is Simsun. I want these to be
rendered as TimesNewRoman, and if I set the selection of the language
to EnglishUK, the change takes place as I expect.
However, I need to do this in a macro that generates the selected
text. If I record the steps in a macro, the change takes place as I
record it. But If I then use the recorded macro to do the same thing,
the changes do not occur.
I cannot find a work-round. Does anyone have any ideas? Tag: hi Tag: 107815
Unicode characters in const string
I want to put Unicode characters in a constant string from which
individual characters will be programmatically selected. Using ChrW is
not possible because const does not allow the use of a function. Tag: hi Tag: 107812
How alter word 2003 doc last page footer without altering other pa
How can the last page footer of a Word 2003 document programmatically be
altered without altering the other pages?
A word template document is used with a visual basic program to generate
over 26,000 individual word documents using details from a file. The
individual word documents can have between 2-30 pages. The footer of this
word template document contains a two cell table. Cell 1 of this table must
contain a different value for the first, middle, and last pages of the word
document. For example, the first page cell 1 must be 20. Last page cell 1
must be 10. The middle pages must be 00. The cell 1 values increment for each
document and are not the same for each document.
If a section break is manually or programmatically added before the footer
of the last page, the first page either appears blank or it becomes section 1
with the rest of the pages becoming section 2 even though the goal was for
the last page footer to become section 2. Inserting a page at the end of the
document and then attempting the section break has the same results.
How can a section break be forced before the last footer without impacting
the other pages?
--
J Smythee Tag: hi Tag: 107804
code required
Hi
Is there any way of reading and modifying word document page by page
in VBA....if so can anybody give me the piece of code
Awaiting for early response
Thanks & Regards
Kalyan Tag: hi Tag: 107802
Formatting based rendering of quotes
How can I set up Word so that when I am in a Courier New font section, and type a single or double quote at
the keyboard, it will use Ascii 39 (') or Ascii 34 ("), respectively?
Details: I'm writing a document in word (Word 2003 on Win XP Pro) with the default Times New Roman, 12pt
formatting. In some sections I am showing computer code, and for those sections I use Courier New, 10pt.
The problem is that when I type a single quote or a double quote in the code sections, they come out as ?left
leaning? or ?right leaning quotes? (ie matched quotes), instead of the 'straight' "quotes" (Ascii 39 and Ascii
34) that code parsers understand. And I'm getting sick of copying single/double quotes from prior code
sections and overpasting them. Hence my question.
Csaba Gabor from Vienna
PS. I originally sent this during the past weekend, evidently in the midst of the "MI5 posting attack" and my
Thunderbird newsreader showed it as sent, but it never showed up in the newsgroup. Anyone know what the story
is on that? Tag: hi Tag: 107799
Populating userform/sharing data
I have two templates, each with their own userforms and they work just fine.
Under certain conditions (a checkbox in userform1 = True) a new document
based on template2 is created. Again this is working fine.
The two documents/templates share a couple of pieces of info and the problem
I'm having is populating userform2 with the relevant info from userform1.
At the moment a command button on userform1 has the code to populate the
bookmarks in template1. The code to test the creation of document2 is in the
terminate event of userform1.
The two templates must also remain separate, in that a new document can be
created from template2 without anything to populate from template1.
I hope that makes some sense! Any pointers will be gratefully appreciated.
h. Tag: hi Tag: 107780
VBA - code for border for a table
In Word 97, I have the following code which takes the selected rows from a
userform and inserts the data in table format into the Word document.
Ideally, I would like the table to be indented at 2.5cm (that is, the
left-hand border of column 1 is positioned at 2.5cm).
What do I need to include into the code to position the table at that
location?
Thank you for any suggestions.
Private Sub CommandButton1_Click()
Dim x As Long, y As Long, tbl As Table, n As Integer
x = ListBox1.ColumnCount + 1
' Count the number of selected records for creation of the table
n = 1
For y = 2 To ListBox1.ListCount + 1
If ListBox1.Selected(y - 2) = True Then
n = n + 1
End If
Next y
Selection.TypeParagraph
Set tbl = ActiveDocument.Tables.Add(Selection.Range, n, x)
tbl.Range.Borders.Enable = False
Dim tblcell As Cell
For Each tblcell In tbl.Range.Cells
tblcell.Borders.Enable = False
Next tblcell
tbl.Columns(1).Width = CentimetersToPoints(2.7)
tbl.Columns(2).Width = CentimetersToPoints(4.75)
tbl.Columns(3).Width = CentimetersToPoints(3.25)
tbl.Columns(4).Width = CentimetersToPoints(3.25)
tbl.Columns(5).Width = CentimetersToPoints(3.25)
Dim rg As Range
tbl.Columns(4).Select
Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
tbl.Columns(5).Select
Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
Dim rgStart As Range, rgEnd As Range
tbl.Range.Font.Size = 11
tbl.Range.Font.Name = "Times New Roman"
tbl.Range.ParagraphFormat.SpaceBefore = 2
tbl.Range.ParagraphFormat.SpaceAfter = 2
tbl.Range.ParagraphFormat.LineSpacing = 12 Tag: hi Tag: 107776
Can you capitalize a word in speach recognition>
Does anyone know how to capitalize a proper name in the middle of a
sentenance when using the voice recognition program in Word 2003? Tag: hi Tag: 107775
what is the format xm. file bibliography? where?
I'm trying to use word 2007 to write a scientific document, so I started
using the new tools to insert citations and bibliography. All this is nice,
BUT I can't import my bibliography database to word, this is what Iâ??m doing:
Access:
Assign the same labels to these use in word (Author, tag, etc.)
Export data to a *.xml file
Word Manage Sources:
Browse,
Choose my file
Error: this is not a bibliography file
It is highly inefficient to write each citation using the tool design for
that in Word, especially when one is using about 300 citations
I have been looking for the file:
http://schemas.open.org/officeDocument/2006/bibliography
Which seems to have the attributes for a bibliography file, but yet no success
I'll appreciate any help
Sandra Correa Tag: hi Tag: 107769
Delete blank lines
I'm trying to delete some blank lines in my document which are above a
bookmark. I want the macro to count the number of blank lines immediately
above the bookmark till the line that contains text. If there is more than 1
blank line it should delete it/them so as to leave a single blank line.
Many thanks. Tag: hi Tag: 107763
Add the document property of Subject to a table in a footer
The table is already in the footer and the built in document property of
Subject needs to be inserted into this 1 row 3 column table in every footer
regardless of how many sections there are in the document. The field needs
to be in the 1st column.
I have the code working to delete anything in that row/column but can not
get it to add without errors.
--
CLG Tag: hi Tag: 107758
Table numbering / STYLEREF problems
Hi, this might not be the most appropriate group (in
which case please redirect me), but I've had good
luck here in the past...
My table numbering is messed up, and it seems to
be on account of the STYLEREF, bit I haven't the
foggiest notion as to why. I'm on Word 2003 / XP Pro
Example: In a fresh word document I put 4 lines
with two newlines separating each:
Chapter 1
text 1
Chapter 2
text 2
Below text 2 I insert a table, and the automatic
table labelling has already been turned on
(in a previous document today I selected an entire
table, right clicked, selected Caption, AutoCaption,
selected Microsoft Word Table, Use label: Table,
Position: Below Item; Numbering: Format: A, B, C, ...;
Include chapter number selected: Chapter starts
with style: Heading 1; use separator: - )
What I get below the table is:
Table Error! No text of specified style in document.-A
where doing Alt + F9 shows
Table { STYLEREF 1 \s }-{ SEQ Table \* ALPHABETIC \s 1 }
If I now click in the select the Chapter 1 line, and apply
style Heading 1 (from the dropdown with AA to the left
I select Heading 1), and similarly for Chapter 2,
and then I go back to the text under the table and
right click, then Update Field, it shows:
Table 0-A
In a longer word document, where I originally created
the AutoCaption, I have several chapters with style
Heading 1, and there I can't get past that Table Error!
I've looked on the web for this error, and there is
mention, but none of the situations seems applicable
here.
Any ideas?
Thanks,
Csaba Gabor from Vienna Tag: hi Tag: 107756
Macro Button that invokes an Acrobat PDF search?
It would be wonderful if the great power provided by Acrobat PDF Advanced
Search Options (when PDF full text indexing is used) could be seamlessly
accessed by a Word user within Word, via a hyperlink or macro button. For
example, if a tech writer is writing a proposal and needs to very quickly
scan all past proposals for examples of [whatever], it would be wonderful if
he/she could click on a macro button embedded in the proposal template for
just this purpose. This envisioned macro would provide a dilaog box for the
writer to type in a search phrase, and then it would launch an Acrobat
Advanced Search, automatically passing that search phrase parameter to
Acrobat where all past proposals reside, fully indexed, for this purpose. I
suspect that macro button would also need to name the index(es) that the
template creator intended to be used for that particular macro button. The
overall idea is to get the user to the desired reference info as effortlessly
as possible, rather than requiring them to go through a bunch of screens in
Acrobat. (it takes at over eight mouse clicks to step outside of Word, find
and launch Acrobat Reader, negotiate one's way to the indexed search screen,
specify which indexes to use, and type the desired search phrase...some
people could forget what they were looking for!)
Could it be that I've come up with (gasp) a great new idea, or (more likely)
i'm just describing something that already exists - or can't possibly exist? Tag: hi Tag: 107748
Protected Forms with Macros
An end-user will be filling out the Word document form fields in a protected
docuemnt. I have created a table. Once they fill in data in the columns I
would like the totals columns to auto sum. I figure the best way to do that
was to have a macro run on entry in the field after the totals.
However, once I protect the document, the macro wonâ??t run. I get a
Microsoft Bisual Basic Run-Time Error 4605 "This method or property is not
available because the document is a protected document".
--
Darlene Tag: hi Tag: 107736