Hey guys I am new to all the macros so please understand I am going into this small project completely blind. The issue I am having is as follows;
We use a Hotel software program that automatically generates the Deposit price in an email and we use outlook. The field reference is not a numerical value it is {DEPREQ} (Accu Cobal program) in which case on generating the email using an HTML template it populates the field text area {DEPREQ} with the numerical value listed in the system.
Here is the problem, the program doesn't populate values for Balance due or Total of reservations and we keep having guests call us for this information. We tried to make it simple by having the deposit 25% of total but guests can't seem to figure out how to use a calculator.
What i am attempting to accomplish is a formula like excel by =SUM(B5)*4 (This will calculate the total reservation cost) and =SUM(B5)*3 (this calculates the balance due). These formulas work both in Word and Outlook, the issue is that they do not auto update and attempting to train employees who have a hard enough time finding the power button on a computer just is not going to work so i have been playing with macros to try to get the fields to auto update at opening of the email.
The following macro works in Word but does NOT work in Outlook
Quote:
Sub AutoOpen()
'
' AutoOpen Macro
'
'
Dim aStory As Range
Dim aField As Field
For Each aStory In ActiveDocument.StoryRanges
For Each aField In aStory.Fields
aField.Update
Next aField
Next aStory
End Sub
|
I have references the VBA to Word 14.0 and the Compile error went away now it doesn't work nor generate any new errors.
What am I doing wrong?