473,382 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

MS Word Macro

Hi Guys,

Im doing a Word macro that i want to count the number of standardized pages in my document. I would like the result to be shown and live updated in the statusbar (beside the word count and so on), but for now I can only get it to appear when i press the macro. Can anyone help me out?

Thanks!

The code looks like this for now:

--------------------------------------------------------------------

Sub Normalsider()
'
' Normalsider Makro
'
'
ns = (ActiveDocument.ComputeStatistics(Statistic:=wdSta tisticCharactersWithSpaces, IncludeFootnotesAndEndnotes:=True) / 2400)
ns = Round(ns, 1)

If ns >= 30 Then
stopstatus = ". Stop for helvede!"
Else
stopstatus = ""
End If

pct = ((ns / 30) * 100)
pct = Round(pct, 2)

If ns <= 1 Then
StatusBar = ns & " normalside" & stopstatus & " (" & pct & "%)"
Else
StatusBar = ns & " normalsider" & stopstatus & " (" & pct & "%)"
End If

End Sub
Dec 7 '07 #1
0 955

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: bekil | last post by:
Thanks for your suggestion Murray Jack. I also record macro while doing it manually in word then I edit the macro to see the required code. Firstly I am creating a blank page. Secondly I go to...
10
by: Brian Kwan | last post by:
Requirement: Call a Word Macro from ASP.NET with parameters Do anyone have idea about this? Please notice the import statement and sample code, as I am a beginner using ASP.NET, thanks for your...
5
by: John | last post by:
Hi My vb.net opens a word document from a word template. I am trying to find when the document is saved by the user so I can make a history in my vb.net app. Here is how I think it may work; ...
3
by: Martin Austin | last post by:
Here's my problem. I'm launching an MS Word object on a Notes document Postopen event. The script kicks off a macro that saves the Word document to a temporary file every n minutes (backup of key...
5
by: Mason | last post by:
I'm having some problems converting VBA for Word 2000 to code that VB.Net understands. I recorded a macro in Word to add numbering (a. b. c.) to my paragraphs. I managed to translate quite a bit...
1
by: ParkMan | last post by:
Hello, I am trying to open a Word template, fill some fields, and mark some check boxes as checked. Here is the code I am using: ' Launch Word and load the report template Set objWord = New...
2
by: steve | last post by:
Hi All What is the word mailmerge.opendatasource syntax when using sql server express as the data source Below is the code when using access.... odoc.MailMerge.OpenDataSource(Name:= _ ...
3
by: vkagrawal | last post by:
Hi I have made a macro in ms word. Corresspondning this macro a form is associated, and on RUN of this macro operation is performed. Now i need to make this macro available as a tool in ms word...
6
by: Eric Layman | last post by:
Hi, I have fields from textareas. With a click of a button, php is able to grab these fields and by using header(), convert the output to Ms Word doc. But the outcome of the word doc...
0
by: A1000ma | last post by:
I am trying to develop a C# program to fill in the blanks in a Word Form. Everything works beautifully while the program is running. I had to go in to fix some links on our Web Site a couple of...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.