Search results

  1. C

    Adding Windows username in a new record?

    No it sould be like this : Behind Module : Option Compare Database Option Explicit Private Declare PtrSafe Function apiGetUserName Lib "advapi32.dll" Alias _ "GetUserName" (ByVal lpBuffer As String, nSize As Long) As Long Public Function GetNetworkUserName() As String On Error GoTo...
  2. C

    Adding watermark in word using Access VbA

    Aman, Glad it workt to with excel/vba.... Success Contractor
  3. C

    Adding watermark in word using Access VbA

    Aman, it was a difficult birth, but it ended well, i'am glad to help if i can... Don(t forget to push the thank button ;) Contractor
  4. C

    Adding Windows username in a new record?

    Hi, You should put this code after Option explicit : Option Compare Database Option Explicit Private Declare PtrSafe Function apiGetUserName Lib "advapi32.dll" Alias _ "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long Contractor
  5. C

    Adding watermark in word using Access VbA

    Aman, Change this : "C:\Documents and Settings\Amanpreet Kaur\Desktop\PAPSLD.JPEG" to : "C:\Documents and Settings\Amanpreet Kaur\Desktop\PAPSLD.JPG" let me now if its working
  6. C

    Adding watermark in word using Access VbA

    Aman, This problem occurs because you are using Access 2003, Change the following code on your module with this : Public Function InsertHeaderLogo(fnBackGroundPic As String) Dim Shp As Word.Shape On Error Resume Next 'Background Picture If Not fnBackGroundPic = "" Then...
  7. C

    Adding Windows username in a new record?

    Hi Nate You probably did put a text after end sub, like "It's safer" Remove the unnecessary text from the code.... Contractor
  8. C

    Adding watermark in word using Access VbA

    Aman, also add reference Microsoft Office XX Object Lib or you will het error on the line "msotrue" Contractor
  9. C

    Adding watermark in word using Access VbA

    Aman, I have Check your db, and apparently You didn't declare the following on your module : Option Compare Database Option Explicit Public WordApp As Word.Application Public WordDoc As Word.Document Public WordLogo As Word.InlineShape The code works fine after adding the declarations on...
  10. C

    Adding watermark in word using Access VbA

    Aman, I hove tried it out on the db that i previously posted and it works fine on my word document (template.docx). I have no idea what the reason can be.... Contractor
  11. C

    Hello!

    Hi Tomsm, Welcome :)
  12. C

    Adding watermark in word using Access VbA

    Aman, You should set the Bookmark in the header section on the first paragraph, Contractor
  13. C

    FileCopy command for each record in recordset

    Hi Wouter, Try to change your code as following : If rs.RecordCount <> 0 Then rs.MoveFirst Do Until rs.EOF rs.Edit FileCopy Sourcepath, Destinationpath rs.Update rs.MoveNext Loop End If
  14. C

    Adding watermark in word using Access VbA

    Aman, Look at the following link http://www.addictivetips.com/microsoft-office/word-2010-bookmarks/ Or google Add bookmark to word document Contractor
  15. C

    Date ranges using child/master fields

    Hi Dazzy Look at the example from Allen Browne http://allenbrowne.com/ser-62.html success, Contractor
  16. C

    Adding watermark in word using Access VbA

    Aman, Did you added a bookmark on your word Document called : BackGroundPicture ? If you don't do that nothing will happen, PS: if you can add example of your database i will look at it. Contractor
  17. C

    Help me on "After Update" Event thanks !

    Hi Domingsum, look at follwing link from Allen browne http://allenbrowne.com/ser-62.html Success Contractor
  18. C

    Adding Windows username in a new record?

    Hi Nate, To get user name use the code below instead of "Environ" Declare following api Private Declare PtrSafe Function apiGetUserName Lib "advapi32.dll" Alias _ "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long 'Purpose: Returns the network login name 'Return...
  19. C

    Adding watermark in word using Access VbA

    Hi aman, Sorry for that, i forgot to add the errorhandler to the code, i have edited my privous post, regards, Contractor
  20. C

    Adding watermark in word using Access VbA

    Hi aman, code behind Form on Button : Private Sub Command0_Click() Call WordSetup("C:\Documents and Settings\Desktop\Doc1.doc", "C:\Documents and Settings\Amanpreet Kaur\Desktop\LTC.JPEG") End Sub Code Behind Module : Sub WordSetup(fnTemplate As String, fnBackGroundPic As String) On Error...
Back
Top Bottom