digital signature disappears
I wrote soome real basic code to automatically sign using a users
digital signature. When you click a button on the document, it asks
for initials, then asks you to select a certificate, then saves the
signed file to the desktop.
This works well with most users, but I have a user that keeps dropping
the signature from the document when they e-mail it. Are there any
known compatiblilty issues between 2007 and 2003?
The code was written for Word 2003, but the user has Word 2007. The
sig is there before he e-mails it.
Thoughts? Tag: Insert, Object, CPSSpaceIndicator Tag: 114552
My first GLOBAL TEMPLATE
I have created my first global template, allowing me to remove about 400
autotext entries from each user's normal.dot and moving these into a group
template named "groupautotext.dot". The "groupautotext.dot" has now been
copied into a MSWORD startup folder. Tested this on a few secretary pc's
last night, all looked good......until this morning, Friday the 13th, MSWORD
is crashing all over the place for these pc's. Each secretary that I've done
this for cannot complete a document before the dreaded crash.
My questions:
1)I created a folder "MSWORDstartup" off of the "C" drive, copied
"groupautotext.dot" into this folder, changed the startup location to point
to the path "C:\MSWORDstartup". Could it be because I have changed the
default startup location??
2)This is the first time I've worked with global templates, is this behavior
to be expected??
I had to take the global template out of the startup to allow the
secretaries to continue to work. I really don't want to give up on the
"global" template idea, it really would work for what I am trying to
accomplish, although with the behavior that I am seeing with this, the global
at this point, could not work for me.
Diane Tag: Insert, Object, CPSSpaceIndicator Tag: 114550
Locating cursor in text files in VB
How to get any required location in a text file in VB,to print certain contents
in specified location?
i=Loc(#1) gives the current location but while i do
seek #1,i
print #1,"Some data at specified location"
this print is getting printed in the text file at some position but not at
the place
where LOC is pointing. how to achieve this?
Im saving the text file as *.html to genearte html page in the end. Tag: Insert, Object, CPSSpaceIndicator Tag: 114544
curser location
How to write Text Data to File at Specified at location. i tried with Loc and
Seek..But dont work properly. Tag: Insert, Object, CPSSpaceIndicator Tag: 114542
Copy/Paste
Hi Everyone,
I was wondering if it is possible for me to use VBA somehow to import
some data from an excel file.
i.e. Open up excel file and copy some data from particular sheets then
paste into word file on particular pages.
I tried to put some macros in excel VBA but it seems that excel VBA
does not recognize .doc file to begin with.
I have a really big excel file report and every month I have to copy &
paste each section in excel worksheet to word document to create a
hard report and as you can tell it is pain in the axx.
Can anyone help?
Thank you ! Tag: Insert, Object, CPSSpaceIndicator Tag: 114534
detecting bullet style?
Can anybody give some advice how to detect which one of bullet style is
applied to list. I know how to detect difference between bullets and
numbered styled list, but i want to differ is it roman style or for example
is it circle or square?
Ivo
thanks a lot for any help. Tag: Insert, Object, CPSSpaceIndicator Tag: 114527
Distribute Doc?
I have a DOT file, with extensive Userforms. I need to distribute this file
via email to a large number of people who will fill in the forms, generate a
print-out, save the file with their responses and email it back. I don't
really understand the relationship between the DOT and DOC files. Any help
you can give me or resources you could provide that would help me, I
sincerely appreciate.
Thank you,
SoCal Rick Tag: Insert, Object, CPSSpaceIndicator Tag: 114522
Macro to increment field by one- suggestions?
Greetings,
I'm working on a large document (with many section breaks), and I would like
to have a field in the footer which is "Revision Number". I don't want to
use Word's RevNum field because that increments each time a user saves the
document. (I don't want to increment the field just because I'm fixing a
typo.)
This isn't supposed to be an iron-clad system, but I just want a way that,
after I've made significant changes to my document, I can click a toolbar
macro, increment the value by one, and have a message box tell me "Revision
Number increased to XYZ". Ideally, I could also keep the field editable, so
I could just type in "001" whenever I wanted to start the numbering over (for
whatever reason).
Any ideas or resources? It's been a long time since I programmed VBA from
scratch. Thanks! Tag: Insert, Object, CPSSpaceIndicator Tag: 114517
Drop Down List help
I have created a drop down list that has 6 options. I want to create a
second list based on their answer in the first list
example:
list 1: a,b,c,d,e,f
if a is picked in drop down 1 then drop down 2 will display
1,2,3,4,5,6,7,8,9,10
If b is picked then drop down 1 will display 11,12,13,14,15,16,
etc etc Tag: Insert, Object, CPSSpaceIndicator Tag: 114509
Error check for cursor position
Is there any code to make the following work:
Private Sub RadBtnTMS1_Click()
'if
'cursor is placed in an empty line within a cell then
ActiveDocument.TrackRevisions = True
'else
Exit Sub
End Sub
I want that, upon the selection of a radio button, the program enables track
changes IF and ONLY IF the cursor is placed in a line with no text.
Thank you,
Juan Tag: Insert, Object, CPSSpaceIndicator Tag: 114502
Customize Toolbar with Macros in Current Template
I am making a template for distribution to a team. I want to make some
macros accessible via a customized toolbar I am making for my
template. But the macros in the template aren't available in the list
of macros in the Toolbar Customization dialog box. It looks like only
macros from other global templates are available.
Is there any way to do what I want to do? Tag: Insert, Object, CPSSpaceIndicator Tag: 114498
Drop Down List - "Other" Option
Hello, I have a form with a drop down box. The last option in the
drop down box is "Other". If someone selects that, I would like to
force them to type in what the "other" thing is. Is there a way to do
that?
Thanks a million,
Shell Tag: Insert, Object, CPSSpaceIndicator Tag: 114496
Appending new pages when filling out form
I have a one page form that I need some help with. The form is used to track
daily account summaries and has space enough for two accounts. The problem is
there may be more than two accounts for that day. What I want to avoid is
having to open a new instance of the template for each two accounts.
Is there a way to insert new pages with the form layout as needed within the
same document? Like maybe a custom toolbar with an insert page button (how
would you do that?) or something? And while I'm thinking about it, if the
answer is a custom toolbar, can they be document specific? That is, would I
see the toolbar if I was working on some other document?
Thanks very much for any help Tag: Insert, Object, CPSSpaceIndicator Tag: 114495
Need a check before printing
Hi All,
I'm new to VBA. Need to solve the following problem: when a user
prints a document I need to check whether the "Print on both sides"
option is chosen, else pop-up a message to chose that option.
Thanks in advance
Regards
-ArunDhaJ Tag: Insert, Object, CPSSpaceIndicator Tag: 114489
Silently Mark Tables and Cells
I want to mark some cells with a tag that isn't displayed to the user.
Something like the ID attribute in an HTML tag.
However, when I try to use Selection.Range.Cells(1).ID = "something", the ID
doesn't persist between document sessions. That is, when I close and reopen
the document, even with a save, it is no longer set. This is evidenced with
another macro which has the following code:
MsgBox (Selection.Range.Cells(1).ID)
Any help with this is greatly appreciated. Tag: Insert, Object, CPSSpaceIndicator Tag: 114486
Modules in DOT not being transferred to DOC when saved
We have a Document template with a module containing some very old
code. (Basically,it unprotects the document and spell checks inside of
some cells).
Unlike all previous versions or Word, when the user saved the
document, this module was transferred the the newly created Doc file.
Under 2007, it's not. The entire model is omitted.
Is this a security option I can change or do I have to change the code? Tag: Insert, Object, CPSSpaceIndicator Tag: 114475
Vertical Alignment = Top on page 2
When creating a MS WORD template, is there anyway in the page setup to
indicate CENTER vertical alignment only for page 1, anything beyond page 1
should have TOP vertical alignment. The option of "JUSTIFY" allows for too
much spacing between text and images. Is it possible to do a statement like
this in the footer of the document, {IF{PAGE}>1"verticalalignment=top"}}
Diane Tag: Insert, Object, CPSSpaceIndicator Tag: 114472
Word 2007 macro IncludeText
I have @400 individual Word files that I need to combine into a single Word
file. All the files live in one directory. I'm currently using an AutoOpen
macro to loop thru each of the individual files and 'include' the text using
"Selection.InsertFile".
This works ok but is very slow. Is there a better way to combine lots of
Word documents into a sigle word Document? Tag: Insert, Object, CPSSpaceIndicator Tag: 114468
line breaks
how do i keep a date or name together at the end of a line in the body of a
letter? In WordPerfect it is just Control Space. Tag: Insert, Object, CPSSpaceIndicator Tag: 114457
Line and page number
Hi,
How do i find the line and page number using a macro?
--
Rich...
http://www.jadwizracing.co.uk Tag: Insert, Object, CPSSpaceIndicator Tag: 114448
Moving cursor
I'm just starting to learn VBA and am having problems moving the cursor. I
have the following code:
Private Sub txtInterviewDate_AfterUpdate()
If txtInterviewDate.Value < txtGBStartDate Then
MsgBox "The InterviewDate must be greater then or equal to the
GBStartDate"
txtInterviewDate.Value = Null
End If
End Sub
This does work fine but the cursor moves to the next textbox and I want it
to be in txtInterviewDate textbox so the date can be re-entered. It's
probably really simple but the different things I tried don't work. Thanks
for the help. Tag: Insert, Object, CPSSpaceIndicator Tag: 114447
Insert graph with macro
Hi,
Im looking to use a macro to insert a graph into word, the data is in a
file which looks something like this 25,26,15,8 and so on.
How do I do this?
--
Rich...
http://www.jadwizracing.co.uk Tag: Insert, Object, CPSSpaceIndicator Tag: 114446
hiding tables
I have a form upon where I need to hide form fields and text if another field
is populated.
I have done this with paragraphs and works great, however in this form the
fields and text are inside tables so the paragraph does not work.
ie:
ID: <CLID>
In paragraph to hide both I code
With ActiveDocument
ActiveDocument.Unprotect
.FormFields("CLID").Range.Paragraphs(1).Range.Font.Hidden = True
ActiveDocument.Protect wdAllowOnlyFormFields, NoReset
in this new form where I use this it will only hide the formfield.
How can I hide a whole table?
Thanks,
Bryan Tag: Insert, Object, CPSSpaceIndicator Tag: 114443
Lost Bookmarks when mail merging
Hi there
I have the following code that creates a mail merge final document and names
it then allows the user to edit the remaining document. This all works fine
but I have added dookmarks to the template to use for selection of text but
these bookmarks are missing. Where have I gone wrong with my code?
Sub LC1()
'
' LETTER Macro
' Macro created 07/11/2006 by Graham Dingley
'
Application.WindowState = wdWindowStateMinimize
Dim MMMDoc As Document
' This part creates a new document based on the open template
Set MMMDoc = Documents.Open("c:\customers\nelsons\cravefamily.dot")
'***************************************
ActiveDocument.MailMerge.OpenDataSource Name:="C:\WPDOCS\LC1.DOC", _
ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="", SQLStatement:="",
SQLStatement1 _
:=""
ActiveDocument.MailMerge.ViewMailMergeFieldCodes = False
With MMMDoc.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
MMMDoc.Close SaveChanges:=wdDoNotSaveChanges
Set MMMDoc = Nothing
Selection.HomeKey Unit:=wdStory
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="CasePath"
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
' This part goes to the start of the document and sets up a Bookmark
called CasePath using the field CASEPATH from Lawmaster
CasePath = ActiveDocument.Bookmarks("CasePath").Range.Text
ChangeFileOpenDirectory CasePath
ActiveDocument.SaveAs FileName:="Family Crave - " & Format(Now(),
"dd-mm-yyyy hh-mm-ss") & ".doc", FileFormat:=wdFormatDocument,
LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="",
ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False,
SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
' After saving the document the bookmark is removed then document is
resaved, the cursor is sent to the end of the document and Word is maximised
to allow the user to carry on typing
Selection.HomeKey Unit:=wdStory
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
CommandBars("Mail Merge").Visible = False
ActiveDocument.Save
Selection.EndKey Unit:=wdStory
Application.WindowState = wdWindowStateMaximize
Selection.EndKey Unit:=wdStory
Selection.MoveUp Unit:=wdLine, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
CommandBars("Mail Merge").Visible = False
ActiveDocument.Save
Application.WindowState = wdWindowStateMaximize
Selection.HomeKey Unit:=wdStory
End Sub
Thanks in advance for any help. Tag: Insert, Object, CPSSpaceIndicator Tag: 114437
Send Word Data to Excel
Someone sent me a document today, where I can double-click on a section, like
a name, address, a telephone number, etc., and the entire section becomes
active available for inputting text. So you can double-click, add your
names, a few other strings of text, and even click on little boxes which show
check â??xâ?? marks when clicked. I am wondering what kind of formatting this
is. Also, I am wondering if there is a way to use VBA to take all of these
inputs from a user, and click a button to export each â??rangeâ?? to Excel. Iâ??ve
done programming in Excel, and used DocVariables in Word, to send information
from excel to Word. It worked quite well in fact. I have never taken
variables from Word, and exported then to Excel though. Iâ??m pretty sure if
you can go one way, you can go the other way too.
Iâ??ve read the info. here:
http://www.word.mvps.org/FAQs/InterDev/ControlXLFromWord.htm
This site is great, but I donâ??t think this is going to give me the answer
that I am after. Is there another resource oin the web that describes how to
get data from Word to Excel?
Finally, the document seems to be protected. Most of the controls are
disabled in the Word document. Where can I go to enables all the standard
Word features?
Regards,
Ryan---
--
RyGuy Tag: Insert, Object, CPSSpaceIndicator Tag: 114431
Tab key problem in a protected document containing a VB control
Steps to reproduce the problem:
1) Create a document with protected and non-protected sections
2) Create a table in a non-protected section.
3) Protect the document. Note that the tab key advances the cursor to the
next cell in the table, as expected.
4) Unprotect the document and turn on design mode.
5) Add any Visual Basic control anywhere in the document.
6) Turn off design mode and protect the document again. Now try to press tab
in the table - it will jump to the next unprotected section (or back to the
top). Even if you remove the VB control, the tab behavior is still affected.
I tried overriding the tab key behavior by creating a macro named NextCell,
but I found that once you add the VB control it no longer calls this function
- it's doing something else. I couldn't find anything on Microsoft's support
site about this issue, and couldn't find a solution via google searching
either.
This problem is very annoying as I could benefit from being able to use VB
controls in a protected document. But if the users can't navigate the table
as usual (especially tabbing past the end to create new rows), I have to find
workarounds using macros and toolbar buttons.
I am using Word 2000, so maybe the problem was fixed in a later version. I'm
rather doubtful, but please let me know if it works in your version so at
least I know I can use VB controls in the future (if we ever get around to
upgrading). Any suggestions for workarounds are also appreciated.
Thanks,
Elbyron Tag: Insert, Object, CPSSpaceIndicator Tag: 114429
Selection.Find.Execute FindText:=OrigDocID, ReplaceWith:=NewVersio
I'm using this line of code to find a specific section of text (OrigDocID) in
a document and replace it with different text (NewVersion).
Previously lines are:
Selection.HomeKey
Selection.MoveRight unit:=wdSentence, Extend:=wdExtend
The FindText is completely ignored, as if the data wasn't found. Both
OrigDocID and NewVersion are of the format: "9999999v99".
Any questions or ideas?
Thanks,
Wes Tag: Insert, Object, CPSSpaceIndicator Tag: 114426
How to erase (or insert) numbered paragraph if applicable only
Word 2003. Legal documentation.
I have a contract w/paragraph numbering (1. xxx) followed by paragraph in
bodytext. I want the user to delete the numbered paragraph and following
bodytext paragraphs (or insert, whichever is easiest) if the paragraph is not
(or is) applicable to them. Obviously without loosing formatting nor the
sequence in paragraph numbering (b/c of cross-referencing later in the
document). I thought of adding the text in a command and have it
erased/inserted via a bookmark when the user clicks on the "Yes/No" of a
msbgox. But, I would like all this to be kind of cross-referenced. If the
user clicks "Yes", text shows; if the user clicks "No", text disappear. If
the user comes back to the msgbox and reclicks "Yes", then the text would
reappear. Paragraph are relatively small. I tried with bookmark but did not
get the results I had hoped.
Hope I am making sense. Thx. Tag: Insert, Object, CPSSpaceIndicator Tag: 114425
Formatting with InsertFile
I'm trying to combine two word documents into a single file using the
InsertFile method and it seems to be working pretty well, except for
the formatting in the final document.
The individual word docs that need to be combined are styled using a
template that keeps some text on top in a single column while
formatting the rest of the doc in two columms. The problem I'm seeing
is that everthing below the first document's (DocA) header text is
getting styled in two columns - including the header of the second
document which should be in a single column.
Here's my code:
'Loop through all the files in the temp dir and copy them to one file
Dim oFinalDoc As Word.Document = oWord.Documents.Add()
Dim oFinalSelection As Selection = oWord.Selection()
For Each oFile As FileInfo In oDir.GetFiles("*.doc")
oFinalSelection.InsertFile(oFile.FullName)
oFinalSelection.InsertBreak(Word.WdBreakType.wdPageBreak)
Next
oFinalDoc.SaveAs("C:\Windows\Temp\1234\FinalDoc.doc")
Would appreciate any help in figuring out how to retain the formatting
in the final doc exactly as it is in the individual docs.
Thanks,
Fauzia Tag: Insert, Object, CPSSpaceIndicator Tag: 114421
Automate the "File/Send/As Attachment" as an embedded link in Word
I need to send out a word document that I will need to have my sales reps
fill out. I would like to add a link at the bottom of that word document that
when clicked will automatically send that word document with the changes made
to me as an attachment in an email. Basically what I'm asking... is there a
way to automate the "file/send/as attachment" feature with a button embedded
in the word doc? Word 2003
--
Thank you,
Kari Tag: Insert, Object, CPSSpaceIndicator Tag: 114420
VBA Code Cleaner with Vista?
From what I've read here, people are successfully using the VBA code cleaner
available here: http://word.mvps.org/faqs/macrosvba/TemplateBloat.htm
I've just tried to install it on my PC with Vista, and the installation
fails. The Word Code Cleaner.dot template isn't created. Any suggestions on
what I can do to make this work?
--
Colleen Tag: Insert, Object, CPSSpaceIndicator Tag: 114418
Publisher overrides Word in default
Whenever I try to open a word document from an email or from the start menu,
Publisher opens and tries to convert the document to publisher.
The only way I can open a word document with Word is to right click on the
document and select open with.... word.
This just started after I installed AVG free protection. I don't know if
that has anything to do with it or not.
How do I stop it? Tag: Insert, Object, CPSSpaceIndicator Tag: 114417
When I print; header changes and inserts file number
Header is correct when file is saved and reopened. When I print the doc. the
header changes on all pages and the file number is inserted into the original
header text . Tag: Insert, Object, CPSSpaceIndicator Tag: 114416
Modify a text box into a chart
Hi !
I'm wondering if there a way to modify a text box inside a chart ?
1)When I loop on the text box of the ActiveDocument (Dim sh As Word.Shape,
For Each sh In ThisDocument.Shapes, Debug.Print sh.Name), the text box inside
the word chart is not include.
2) I tried the following to edit the graph but I don't know how to reach the
text box range include in the chart. Any idea?
Dim rng As Word.Range
Dim of As Word.OLEFormat
Dim oChart As Graph.Chart
Set rng = ThisDocument.Bookmarks("BarChart").Range
Set of = rng.InlineShapes(1).OLEFormat
On Error Resume Next
of.DoVerb wdOLEVerbInPlaceActivate
On Error GoTo 0
Set oChart = of.Object
Thank you!
Alex
--
Alex St-Pierre Tag: Insert, Object, CPSSpaceIndicator Tag: 114414
Centering text in VBA code?
Good morning folks, I have a quick question:
I'm creating a form where the individual headings on the document will
change depending on the selections made in the form. I would like to
center these headings, to make them stand off from the text below
them. Is there a way to do this without centering the bookmark?
Thanks in advance,
Robbie Tag: Insert, Object, CPSSpaceIndicator Tag: 114410
Delete any redundant spaces at the end of footnotes
Dear Experts:
Is it possible to ask Word via VBA to delete any redundant spaces at
the very end of footnotes (that is all the footnotes should either end
with the last character of the respective word or a full stop and then
the paragraph mark should be the last "character").
Help is appreciated. Thank you very much in advance.
Regards,
Andreas Tag: Insert, Object, CPSSpaceIndicator Tag: 114405
Content controls behaviour inside <w:p>
Content controls inside <w:body> tag are only allowing us to press enter
keys, custom elements, <list> tags formatting. This scenario is mentioned in
the attached document â??New Approach â?? Array and Statement tag.docxâ??. Content
controls inside body are extendable.
OpenXML for this scenario would be.
<w:body>
<w:customXml w:uri="http://schemas.microsoft.com/office" w:element="array">
<w:sdt>
<w:sdtPr>
<w:id w:val="90283052"/>
<w:placeholder>
<w:docPart w:val="DefaultPlaceholder_22675703"/>
</w:placeholder>
</w:sdtPr>
<w:sdtContent>
<w:p w:rsidR="00506299" w:rsidRDefault="00506299"
w:rsidP="00506299">
â?¦
<w:p w:rsidR="00506299" w:rsidRDefault="00506299"
w:rsidP="00506299">
â?¦
</w:p>
</w:sdtContent>
</w:sdt>
</w:customXml>
</w:body>
Content controls inside <w:p> tag(s) is not allowing to press enter key.
Its behaviour is like inline content control. In this scnerio we are unable
to support custom tags inside <w:p>. This scenario is mentioned in the
attached document â??Statement inside p.docxâ??. In most of the PubMed XML we
require nesting of <p> tags and inside <p> we would required content controls.
<w:body>
<w:p>
<w:sdt>
<w:sdtPr>
<w:id w:val="90283052"/>
<w:placeholder>
<w:docPart w:val="DefaultPlaceholder_22675703"/>
</w:placeholder>
</w:sdtPr>
<w:sdtContent>
â?¦
</w:sdtContent>
</w:sdt>
</w:p>
</w:body>
We would like to achieve:
Add content controls inside <w:p> where user should able to press enter key,
add bulleted list.
Let us know wheter you have any other approach for such scenarios.
As an example we want to generate custom tags content controls (OpenXML) for
below XML:
<sec sec-type="subsection" id="subsec2.2">
<title>2.2. Definitions of different repeats in DNA
sequences</title>
<p>
<statement id="d1">
<p> Some Test </p>
</statement>
<p> tttt </p>
</p>
</sec>
<sec> and <statement> custom tag requires content controls. Tag: Insert, Object, CPSSpaceIndicator Tag: 114397
How to connect to an Oracle Database from a Word Macro
Hi,
I'm trying to figure out the best way to connect to an Oracle database via a
Word Macro. I'd quite like to avoid installing the Oracle client software on
all the client machines, so I gather my best option is to connect using the
Microsoft ODBC driver for Oracle.
I plan to create a File DSN on each machine that uses the document by some
automatic means.
The thing is, I can't find any example syntax for
a) Creating the File DSN to connect to Oracle
b) Connecting to the Oracle database using the ODBC driver.
Maybe I'm missing something obvious here, but I'm really stumped! Can anyone
help?
Thanks in advance,
--
Kenny.
Systems Developer Tag: Insert, Object, CPSSpaceIndicator Tag: 114395
Blank screen on reply
When trying to open a responce all I get is a blank screen most of the time.
Have to use other ways in then work around to responce I am trying to get to.
Who can we inform of this problem?
Thanks Tag: Insert, Object, CPSSpaceIndicator Tag: 114391
ActiveDocument.Content vs ActiveDocument.Range
Can anyone tell me the difference between ActiveDocument.Content and
ActiveDocument.Range? From reading the VBA help it appears that if you don't
specify a Start or End for ActiveDocument.Range it works the same as
ActiveDocument.Content.
Or have I missed something...?
--
Cheers!
Gordon
The Kiwi Koder
Uninvited email contact will be marked as SPAM and ignored. Please post all
follow-ups to the newsgroup. Tag: Insert, Object, CPSSpaceIndicator Tag: 114387
sending message and print preview word 2003
hi! when i write i always have a converse p sign at the end of the line when
i try to remove it by clicking on the show/hide button i get a blank
page.when i click on print preview i get a blank page,when i email the
document the recipient get it blank what should i do please?
--
thanks for helping! Tag: Insert, Object, CPSSpaceIndicator Tag: 114386
working without the hide/show button on word 2003
when i remove the converse p sign after writing my text i get a blank
page,when i send the message,the receipient get it blank,when i ask for print
preview i get a blank page what should i do?
--
thanks for helping me! Tag: Insert, Object, CPSSpaceIndicator Tag: 114385
how to view the print preview on word 2003?
when i clic on print preview i get a blank page,when i send a mail the
recipient receive a blank page
--
thanks for helping! Tag: Insert, Object, CPSSpaceIndicator Tag: 114384
Need code for enter key
With ActiveDocument
.Separator = wdSeparatorTab
End With
With above got delimiter window to come up as tab instead of blank. Now I
need to be able to insert a code for enter or mouse click to go past window.
This will then allow macro to proceed.
Many thanks to all Tag: Insert, Object, CPSSpaceIndicator Tag: 114382
Creating Several .doc files from one big .doc file
I have been give a Word file that contains 25-50 letters to different people.
The only thing separating them is a Section Break. I need to know how I can
make them separate files. I will then need to make each one a .pdf - Any
help would be greatly appreciated. Of course this is a file that I will be
receiving weekly, so I really don't want to go through each one and cut and
paste to new docs.
Thanks,
Shadowfax Tag: Insert, Object, CPSSpaceIndicator Tag: 114376
AutoNew with fld.Unlink not working in docs created from template
Hi
I'm using 2003/XP and have recreated a basic Word 2000 template by
copy & pasting into my 2003 blank doc (without the last paragraph
mark) and have inserted fields like this:
{ FILLIN "ENTER TECHNICAL REPORT TITLE" \d "ENTER TECHNICAL REPORT
TITLE" } and have created an AutoNew vba in the template as below:
' AutoNew Macro
'updates the FILLIN & ASK fields and displays the appropriate prompts
when
'a user creates a new document based on your template, and then
unlinks them
'so the prompts don't keep reappearing.
Sub AutoNew() 'from http://word.mvps.org/FAQs/Customization/FillinTheBlanks.htm
Dim Fld As Field
ActiveDocument.Fields.Update
For Each Fld In ActiveDocument.Fields
If Fld.Type = wdFieldAsk Or Fld.Type = wdFieldFillIn Then
Fld.Unlink
End If
Next Fld
Selection.GoTo What:=wdGoToBookmark, Name:="Exec_Summary"
End Sub
however when I create a .doc from the template the FILLIN are
repeating, there are currently no ASK. It does jump to the Exec
Summary section when I cancel out of the FILLINS.
Do I need a Do Until?
Also tried
Sub AutoNew()
Selection.WholeStory
Selection.Fields.Update
Selection.GoTo What:=wdGoToBookmark, Name:="Exec_Summary"
End Sub
with the same result.
Thanks again for all the great advice I've received.
Peta Tag: Insert, Object, CPSSpaceIndicator Tag: 114374
How to create two page-numbering in one document?
Hello.
There is Microsoft's article "How to create two page-numbering schemes
in one document in Word 2003 and in Word 2002" on the site
http://support.microsoft.com/kb/291283/en-us. I try create my macro on
basic of it (first method with the field SEQ). But I can't overcome
numbering into header and footer. My head by this time turn. That is
the file as example (http://www.box.net/shared/repk7lsg84), and lower
my code. Please, help me and give me a tip.
Thank you very much.
My code:
Sub twinNumberingPages3()
Dim sec As Section
Dim myRange As Range
Dim myR As Range
Dim nSec As Integer
Dim nIndex As Integer
Dim i As Integer
ActiveWindow.View.ShowFieldCodes = True
nSec = ActiveDocument.Sections.Count
Selection.HomeKey unit:=wdStory
With Selection
.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
preserveformatting:=False
.TypeText Text:="seq v1 \h \r "
.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
preserveformatting:=False
.TypeText Text:="sectionpages"
.MoveRight unit:=wdCharacter, Count:=4
.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
preserveformatting:=False
.TypeText Text:="seq v2 \h \r0"
End With
If nSec > 1 Then
For nIndex = 2 To nSec
ActiveDocument.Sections(nIndex).Range.Select
Selection.Collapse wdCollapseStart
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:="seq v1 \c", _
preserveformatting:=False '
Selection.MoveLeft unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
_
preserveformatting:=False
Selection.TypeText Text:="seq v2 \h \r"
Selection.MoveRight unit:=wdCharacter, Count:=1,
Extend:=wdExtend
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
_
preserveformatting:=False
Selection.TypeText Text:="="
Selection.MoveRight unit:=wdCharacter, Count:=5,
Extend:=wdExtend
Selection.Collapse wdCollapseEnd
'
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:="sectionpages", _
preserveformatting:=False
Selection.TypeText Text:="+"
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:="seq v2 \c", _
preserveformatting:=False
Selection.MoveLeft unit:=wdCharacter, Count:=3, Extend:=wdExtend
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
_
preserveformatting:=False
Selection.TypeText Text:="="
Selection.MoveLeft unit:=wdCharacter, Count:=3, Extend:=wdExtend
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
_
preserveformatting:=False
Selection.TypeText Text:="seq v1 \h \r"
Next nIndex
End If
ActiveDocument.Range.InsertAfter vbCr
Set myR = ActiveDocument.Range
myR.Collapse direction:=wdCollapseEnd
myR.Select
With Selection
.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:="seq
v2 \c", preserveformatting:=False
.TypeText Text:="+"
.Fields.Add Range:=Selection.Range, Type:=wdFieldPage,
preserveformatting:=False
.MoveLeft unit:=wdCharacter, Count:=3, Extend:=wdExtend
.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
preserveformatting:=False
.TypeText Text:="="
.MoveLeft unit:=wdCharacter, Count:=3
.MoveRight unit:=wdCharacter, Count:=1, Extend:=wdExtend
.Fields.Update
End With
Selection.Cut
ActiveDocument.Paragraphs.Last.Range.Delete
Selection.HomeKey unit:=wdStory
Set myR =
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range
myR.Collapse direction:=wdCollapseEnd
myR.Paste
Selection.HomeKey unit:=wdStory
For i = 1 To ActiveDocument.Sections.Count
Set myRange =
ActiveDocument.Sections(i).Headers(wdHeaderFooterPrimary).Range
For Each sec In ActiveDocument.Sections
With sec.Headers(wdHeaderFooterPrimary)
.Range.Fields.Add Range:=myRange, Type:=wdFieldPage,
preserveformatting:=False
.PageNumbers.RestartNumberingAtSection = True
.PageNumbers.StartingNumber = 1
End With
Next sec
Next i
ActiveWindow.View.ShowFieldCodes = False
End Sub Tag: Insert, Object, CPSSpaceIndicator Tag: 114363
How to Open All Documents in "ONE PAGE" View?
How can I change the following code in my normal.dotm, to make each new
document open in "ONE PAGE" view . . instead of the present 100% view?
Sub AutoNew()
ActiveWindow.View.Type = 3
ActiveWindow.View.Zoom.Percentage = 100
End Sub
Thanks! Tag: Insert, Object, CPSSpaceIndicator Tag: 114361